[7634] Fixed: select non-despawnable gameobjects base at appropriate for gameobject type dataN fields.

Many in world gameobject that unexpected daspawned before must now work in more expected way.

In tests i not found any damage to bg gameobject work, and at least this restore expected work for non-bg dorrs//buttons broken
after half-year ago patch (that has been reverted partly in this commit)

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
VladimirMangos 2009-04-08 05:35:53 +04:00
parent 863a747251
commit 3226a22e29
3 changed files with 37 additions and 26 deletions

View file

@ -479,6 +479,20 @@ class MANGOS_DLL_SPEC GameObject : public WorldObject
}
}
bool GetDespawnPossibility() const
{
switch(GetGoType())
{
case GAMEOBJECT_TYPE_DOOR: return GetGOInfo()->door.noDamageImmune;
case GAMEOBJECT_TYPE_BUTTON: return GetGOInfo()->button.noDamageImmune;
case GAMEOBJECT_TYPE_QUESTGIVER: return GetGOInfo()->questgiver.noDamageImmune;
case GAMEOBJECT_TYPE_GOOBER: return GetGOInfo()->goober.noDamageImmune;
case GAMEOBJECT_TYPE_FLAGSTAND: return GetGOInfo()->flagstand.noDamageImmune;
case GAMEOBJECT_TYPE_FLAGDROP: return GetGOInfo()->flagdrop.noDamageImmune;
default: return true;
}
}
time_t GetRespawnTime() const { return m_respawnTime; }
time_t GetRespawnTimeEx() const
{