swapped isAttackable function for isInvulnerable function in Player class; Also added isInvulnerable check to wolf agro function
This commit is contained in:
parent
909c8fd04f
commit
4e3fec0d97
4 changed files with 5 additions and 5 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) && sourceEntity->isAttackable())
|
||||
if ( sourceEntity != nullptr && sourceEntity->instanceof(eTYPE_PLAYER) && !sourceEntity->isInvulnerable())
|
||||
{
|
||||
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