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

----------

Core/DB: Unify `creature_respawn` and `gameobject_respawn` into a single `respawn` table
This commit is contained in:
Treeston authored and Ovahlord committed 2019-08-18 12:47:10 +02:00
1 parent f9184f026b
commit 90540d684b
15 files changed
+184 -236

No files matched your search

@@ -27,6 +27,7 @@ EndScriptData */
#include "DatabaseEnv.h"
#include "DBCStores.h"
#include "GameEventMgr.h"
#include "GameObject.h"
#include "Language.h"
#include "Log.h"
#include "MapManager.h"
+1 -1
View File
@@ -1918,7 +1918,7 @@ public:
uint32 const gridId = Trinity::ComputeGridCoord(player->GetPositionX(), player->GetPositionY()).GetId();
for (RespawnInfo* info : data)
if (info->gridId == gridId)
player->GetMap()->RemoveRespawnTime(info, true);
player->GetMap()->Respawn(info->type, info->spawnId);
}
return true;
@@ -341,8 +341,8 @@ public:
me->SetReactState(REACT_PASSIVE);
// @todo these guys should really be moved to a summon group - this is merely a hack to make them work in dynamic_spawning
instance->instance->RemoveRespawnTime(SPAWN_TYPE_CREATURE, 130958, true); // Stalagg
instance->instance->RemoveRespawnTime(SPAWN_TYPE_CREATURE, 130959, true); // Feugen
instance->instance->Respawn(SPAWN_TYPE_CREATURE, 130958); // Stalagg
instance->instance->Respawn(SPAWN_TYPE_CREATURE, 130959); // Feugen
}
void UpdateAI(uint32 diff) override