fix(Core/Creature): Allow temp summons to respawn when despawning on … (#21363)

This commit is contained in:
Andrew
2025-02-10 04:46:31 -03:00
committed by GitHub
parent b0a45c98c2
commit 7e29e023e8
6 changed files with 9 additions and 30 deletions

View File

@@ -3718,12 +3718,14 @@ void Map::RemoveOldCorpses()
}
}
void Map::ScheduleCreatureRespawn(ObjectGuid creatureGuid, Milliseconds respawnTimer)
void Map::ScheduleCreatureRespawn(ObjectGuid creatureGuid, Milliseconds respawnTimer, Position pos)
{
_creatureRespawnScheduler.Schedule(respawnTimer, [this, creatureGuid](TaskContext)
_creatureRespawnScheduler.Schedule(respawnTimer, [this, creatureGuid, pos](TaskContext)
{
if (Creature* creature = GetCreature(creatureGuid))
creature->Respawn();
else
SummonCreature(creatureGuid.GetEntry(), pos);
});
}