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
|
|
@ -286,7 +286,7 @@ bool Wolf::hurt(DamageSource *source, float dmg)
|
|||
if (isTame())
|
||||
{
|
||||
shared_ptr<Entity> entity = source->getDirectEntity();
|
||||
if (entity != nullptr && entity->instanceof(eTYPE_PLAYER))
|
||||
if (entity != nullptr && entity->instanceof(eTYPE_PLAYER) && !entity->isInvulnerable())
|
||||
{
|
||||
shared_ptr<Player> attacker = dynamic_pointer_cast<Player>(entity);
|
||||
attacker->canHarmPlayer(getOwnerUUID());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue