Scripts: Replaced calls to ForcedDespawn with DespawnOrUnsummon (calls appropriate AI hooks in case of temporary summons) and made ForcedDespawn private

This commit is contained in:
Shauren
2012-04-24 16:53:37 +02:00
parent 396b1ded1a
commit 1851a2e9e3
18 changed files with 32 additions and 31 deletions
@@ -135,7 +135,7 @@ CreatureBaseStats const* CreatureBaseStats::GetBaseStats(uint8 level, uint8 unit
bool ForcedDespawnDelayEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
{
m_owner.ForcedDespawn();
m_owner.DespawnOrUnsummon(); // since we are here, we are not TempSummon as object type cannot change during runtime
return true;
}
+2 -1
View File
@@ -635,7 +635,6 @@ class Creature : public Unit, public GridObject<Creature>, public MapCreature
void RemoveCorpse(bool setSpawnTime = true);
void ForcedDespawn(uint32 timeMSToDespawn = 0);
void DespawnOrUnsummon(uint32 msTimeToDespawn = 0);
time_t const& GetRespawnTime() const { return m_respawnTime; }
@@ -763,6 +762,8 @@ class Creature : public Unit, public GridObject<Creature>, public MapCreature
bool IsInvisibleDueToDespawn() const;
bool CanAlwaysSee(WorldObject const* obj) const;
private:
void ForcedDespawn(uint32 timeMSToDespawn = 0);
//WaypointMovementGenerator vars
uint32 m_waypointID;
uint32 m_path_id;