From 6c84f6f537d288760dc7c151bfd6f2fe71a61fe7 Mon Sep 17 00:00:00 2001 From: sanctum32 Date: Mon, 21 Oct 2013 06:58:21 +0300 Subject: [PATCH] merged https://github.com/cmangos/mangos-cata/commit/ed3d3ccde9c02257a2c52fad80d3278e66d2c4d0 --- src/game/GameObject.cpp | 17 +++++++++++------ src/shared/revision_nr.h | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index b8c48d169..86308ef60 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -301,6 +301,13 @@ void GameObject::Update(uint32 update_diff, uint32 p_time) { // can be despawned or destroyed SetLootState(GO_JUST_DEACTIVATED); + // Remove Wild-Summoned GO on timer expire + if (!HasStaticDBSpawnData()) + { + if (Unit* owner = GetOwner()) + owner->RemoveGameObject(this, false); + Delete(); + } return; } @@ -433,13 +440,11 @@ void GameObject::Update(uint32 update_diff, uint32 p_time) break; } - if (!HasStaticDBSpawnData()) // Remove wild summoned after use + // Remove wild summoned after use + if (!HasStaticDBSpawnData() && (!GetSpellId() || GetGOInfo()->GetDespawnPossibility())) { - if (GetOwnerGuid()) - if (Unit* owner = GetOwner()) - owner->RemoveGameObject(this, false); - - SetRespawnTime(0); + if (Unit* owner = GetOwner()) + owner->RemoveGameObject(this, false); Delete(); return; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index af0241261..7cb40e8d0 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "12689" + #define REVISION_NR "12690" #endif // __REVISION_NR_H__