fixed zombie pigmen attacking player in creative mode
This commit is contained in:
parent
a195ac7172
commit
909c8fd04f
3 changed files with 8 additions and 1 deletions
|
|
@ -105,7 +105,7 @@ shared_ptr<Entity> PigZombie::findAttackTarget()
|
|||
bool PigZombie::hurt(DamageSource *source, float dmg)
|
||||
{
|
||||
shared_ptr<Entity> sourceEntity = source->getEntity();
|
||||
if ( sourceEntity != nullptr && sourceEntity->instanceof(eTYPE_PLAYER) )
|
||||
if ( sourceEntity != nullptr && sourceEntity->instanceof(eTYPE_PLAYER) && sourceEntity->isAttackable())
|
||||
{
|
||||
vector<shared_ptr<Entity> > *nearby = level->getEntities( shared_from_this(), bb->grow(32, 32, 32));
|
||||
for (auto& e : *nearby)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue