[8676] implemented dead-visible creature flags_extra

with this flag you can specify a creature to be only
visible for dead players - this removes all hacks from
spiritguides/spirithealers from code and allows some other
special creatures

i decided to not implement an extra deathstate cause
actualy those creatures are almost equal to living ones
This commit is contained in:
balrok 2009-10-18 21:01:55 +02:00
parent aa87b7007c
commit a2ff999fd3
13 changed files with 24 additions and 31 deletions

View file

@ -9603,7 +9603,8 @@ bool Unit::isTargetableForAttack(bool inverseAlive /*=false*/) const
if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE))
return false;
if (!(isAlive() != inverseAlive))
// target is dead or has ghost-flag
if ((!isAlive() || (GetTypeId() == TYPEID_UNIT && ((Creature *)this)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_GHOST)) != inverseAlive)
return false;
return IsInWorld() && !hasUnitState(UNIT_STAT_DIED)&& !isInFlight() /*&& !isStealth()*/;