mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 10:55:43 +00:00
fix(Scripts/Midsummer): correctly despawn gameobjects (#19387)
This commit is contained in:
@@ -164,7 +164,7 @@ struct go_firework_show : public GameObjectAI
|
||||
uint32 posIdx = _show->schedule.entries[_curIdx].spawnIndex;
|
||||
if (posIdx < _show->spawns.size)
|
||||
{
|
||||
me->SummonGameObject(_show->schedule.entries[_curIdx].gameobjectId,
|
||||
GameObject* go = me->SummonGameObject(_show->schedule.entries[_curIdx].gameobjectId,
|
||||
_show->spawns.entries[posIdx].x,
|
||||
_show->spawns.entries[posIdx].y,
|
||||
_show->spawns.entries[posIdx].z,
|
||||
@@ -174,6 +174,13 @@ struct go_firework_show : public GameObjectAI
|
||||
_show->spawns.entries[posIdx].rot2,
|
||||
_show->spawns.entries[posIdx].rot3,
|
||||
0);
|
||||
|
||||
// trigger despawn animation for firework explosion
|
||||
if (go)
|
||||
{
|
||||
go->DespawnOrUnsummon();
|
||||
go->AddObjectToRemoveList();
|
||||
}
|
||||
}
|
||||
|
||||
uint32 ts = _show->schedule.entries[_curIdx].timestamp;
|
||||
|
||||
@@ -243,6 +243,7 @@ struct npc_midsummer_bonfire : public ScriptedAI
|
||||
if (_spellFocus)
|
||||
{
|
||||
_spellFocus->DespawnOrUnsummon();
|
||||
_spellFocus->AddObjectToRemoveList();
|
||||
_spellFocus = nullptr;
|
||||
}
|
||||
|
||||
@@ -378,7 +379,10 @@ struct npc_midsummer_bonfire_despawner : public ScriptedAI
|
||||
{
|
||||
// spawnID is 0 for temp spawns
|
||||
if (0 == (*itr)->GetSpawnId())
|
||||
{
|
||||
(*itr)->DespawnOrUnsummon();
|
||||
(*itr)->AddObjectToRemoveList();
|
||||
}
|
||||
}
|
||||
|
||||
me->DespawnOrUnsummon();
|
||||
|
||||
Reference in New Issue
Block a user