Skip to content

Commit

Permalink
Check if unit has UNIT_DYNFLAG_TRACK_UNIT before checking auras to pr…
Browse files Browse the repository at this point in the history
…event prevent unnecessary operations, thanks you QAston for suggesting.
  • Loading branch information
The Game authored and Doxito committed Apr 29, 2012
1 parent f07fa2a commit 6e12f71
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/server/game/Entities/Object/Object.cpp
Expand Up @@ -626,9 +626,10 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask*
if (!target->isAllowedToLoot(creature))
dynamicFlags &= ~UNIT_DYNFLAG_LOOTABLE;
}
if (Unit const* unit = ToUnit())
if (!unit->HasAuraTypeWithCaster(SPELL_AURA_MOD_STALKED, target->GetGUID()))
dynamicFlags &= ~UNIT_DYNFLAG_TRACK_UNIT;
if(dynamicFlags & UNIT_DYNFLAG_TRACK_UNIT)
if (Unit const* unit = ToUnit())
if (!unit->HasAuraTypeWithCaster(SPELL_AURA_MOD_STALKED, target->GetGUID()))
dynamicFlags &= ~UNIT_DYNFLAG_TRACK_UNIT;
*data << dynamicFlags;
}
// FG: pretend that OTHER players in own group are friendly ("blue")
Expand Down

0 comments on commit 6e12f71

Please sign in to comment.