mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
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)
This commit is contained in:
@@ -1421,11 +1421,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->SendObjectDeSpawnAnim(obj->GetGUID());
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user