Prevent instant GO respawn when despawn is called without a valid respawn delay being set (#1313)

* Don't always use respawn delay when using GameObject::Despawn, many objects which call this have a delay of 0 and hence instantly respawn
Requires further research

* Force Corrupted Songflower respawn delay

* Actually use respawn time

* Don't set spawned by default for Cleansed Songflower - it will disappear at next object update, and also causes it to automatically respawn
Instead, leave it as m_spawnedByDefault = false and the timer be a despawn timer. The corrupted flower respawning will remove it from the world
This commit is contained in:
bladez
2018-01-25 07:06:01 +11:00
committed by GitHub
parent 7671a3be19
commit 9ecc3c679d
2 changed files with 11 additions and 2 deletions
+4 -1
View File
@@ -869,8 +869,11 @@ public:
if (GameObject* cleansed = me->SummonGameObject(cleansedEntry, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0.0, 0.0, 0.0, 0.0, 0.0, CLEANSED_PLANT_RESPAWN_TIMER))
{
cleansedGuid = cleansed->GetObjectGuid();
cleansed->SetSpawnedByDefault(true);
}
if (const GameObjectData* data = me->GetGOData())
me->SetRespawnDelay(data->ComputeRespawnDelay(data->GetRandomRespawnTime()));
me->Despawn();
me->DestroyForNearbyPlayers();
}