aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2019-10-17 20:18:25 +0200
committerShauren <shauren.trinity@gmail.com>2021-12-18 23:02:49 +0100
commit7d63166ff3e819e3043f155b3df4007cccb81dee (patch)
tree028f1bc5cf43679456ce88e7ed6ca8c595c9cafc /src
parentd5d04a6c551700665db77770ff0e7cca7e48d631 (diff)
Core/GameObject: Fix battleground flags not showing burning animation
Fix battleground flags not displaying the typical burning animation when they "despawn" (they don't actually despawn, they just change state) (cherry picked from commit 90bb10aa3a490fc701e6f98b32310687af80dea5)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Battlegrounds/Battleground.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp
index 96b2b79884a..a7da1838393 100644
--- a/src/server/game/Battlegrounds/Battleground.cpp
+++ b/src/server/game/Battlegrounds/Battleground.cpp
@@ -1527,11 +1527,22 @@ void Battleground::SpawnBGObject(uint32 type, uint32 respawntime)
if (GameObject* obj = map->GetGameObject(BgObjects[type]))
{
if (respawntime)
+ {
obj->SetLootState(GO_JUST_DEACTIVATED);
- else
- if (obj->getLootState() == GO_JUST_DEACTIVATED)
- // Change state from GO_JUST_DEACTIVATED to GO_READY in case battleground is starting again
- obj->SetLootState(GO_READY);
+
+ if (GameObjectOverride const* goOverride = obj->GetGameObjectOverride())
+ if (goOverride->Flags & GO_FLAG_NODESPAWN)
+ {
+ // This function should be called in GameObject::Update() but in case of
+ // GO_FLAG_NODESPAWN flag the function is never called, so we call it here
+ obj->SendGameObjectDespawn();
+ }
+ }
+ else if (obj->getLootState() == GO_JUST_DEACTIVATED)
+ {
+ // Change state from GO_JUST_DEACTIVATED to GO_READY in case battleground is starting again
+ obj->SetLootState(GO_READY);
+ }
obj->SetRespawnTime(respawntime);
map->AddToMap(obj);
}