[8689] implement function Unit::isInvisibleForAlive

with that i've implemented all known auras which makes
units invisible for alive.. but that's currently quite hacky
i think best would be if we could set a unit-flag after those auras
getting applied
This commit is contained in:
balrok 2009-10-20 17:57:57 +02:00
parent e990d5c509
commit 46389e4e1c
9 changed files with 31 additions and 12 deletions

View file

@ -1746,11 +1746,12 @@ bool Creature::IsVisibleInGridForPlayer(Player* pl) const
if(pl->isGameMaster())
return true;
if (GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_INVISIBLE)
return false;
// Live player (or with not release body see live creatures or death creatures with corpse disappearing time > 0
if(pl->isAlive() || pl->GetDeathTimer() > 0)
{
if (GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_INVISIBLE)
return false;
return (isAlive() || m_deathTimer > 0 || (m_isDeadByDefault && m_deathState == CORPSE));
}