aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/AI
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2019-07-15 17:14:58 +0200
committerShauren <shauren.trinity@gmail.com>2021-12-16 01:33:09 +0100
commiteee950cdd7bcbe9443a53ea5c4cce35444a503f7 (patch)
treeeba357353a54d8a6dc308e0a4c732f6459eb1bee /src/server/game/AI
parentd5e58cef694d3db65f0a27b93099ae4e517685a4 (diff)
Core/Misc: Various dynspawn cleanup and refactors split off from pooling rewrite:
- Map::RemoveRespawnTime(SpawnObjectType, LowType, doRespawn) split into Map::Respawn and Map::RemoveRespawnTime, without the extra boolean - Map::RemoveRespawnTime(RespawnInfo*) merged into Map::DeleteRespawnInfo(RespawnInfo*) and is now private - Map::DeleteRespawnInfo(void) renamed to Map::UnloadAllRespawnInfos to properly describe what it does - Map::ProcessRespawns now actually saves the delayed respawn time to DB if the respawn was delayed - Map::AddRespawnInfo now takes const reference, and returns success as a boolean - Map::AddRespawnInfo no longer offers an unused "replace" parameter - Map::DeleteRespawnInfo no longer offers a variety of unused private overloads - Map::SaveRespawnTime no longer offers a tantalizing writeDB parameter. Parameter is now called "startup" to properly describe what it does. - Map::SaveRespawnInfoDB now takes RespawnInfo reference instead of all the various fields. Still public because compatibility mode. QQ. - Map::GetWorldObjectBySpawnId sanitized - Map::GetXRespawnTime methods sanitized to all go through Map::GetRespawnTime (cherry picked from commit d60082ae866d77a12a9e6d09dfce27fc1cb5df90)
Diffstat (limited to 'src/server/game/AI')
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp2
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
index b8d7dd4c347..91efe5d5312 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
@@ -226,7 +226,7 @@ void EscortAI::UpdateAI(uint32 diff)
if (!isEscort)
me->DespawnOrUnsummon(0, 1s);
else
- me->GetMap()->RemoveRespawnTime(SPAWN_TYPE_CREATURE, me->GetSpawnId(), true);
+ me->GetMap()->Respawn(SPAWN_TYPE_CREATURE, me->GetSpawnId());
}
else
me->DespawnOrUnsummon();
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index 12b7b73beb0..39319151a6f 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -2381,7 +2381,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
map = targets.front()->GetMap();
if (map)
- map->RemoveRespawnTime(SpawnObjectType(e.action.respawnData.spawnType), e.action.respawnData.spawnId, true);
+ map->Respawn(SpawnObjectType(e.action.respawnData.spawnType), e.action.respawnData.spawnId);
else
TC_LOG_ERROR("sql.sql", "SmartScript::ProcessAction: Entry " SI64FMTD " SourceType %u, Event %u - tries to respawn by spawnId but does not provide a map", e.entryOrGuid, e.GetScriptType(), e.event_id);
break;