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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user