aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities/GameObject
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2020-02-08 20:22:37 +0100
committerGitHub <noreply@github.com>2020-02-08 20:22:37 +0100
commit9304e496cbf6ab6c028671fb8526c732ae5d799f (patch)
tree997040bf14477bbd30b9b175aac93fa287de03e1 /src/server/game/Entities/GameObject
parent726d5e91b55d4742dcbd6b0a82d84788dbb117b7 (diff)
Core/Misc: Some refactoring, #23603 prep: (#23676)
- Split SpawnMetadata off from SpawnData - No longer allocate Creature/Gameobject objects in ObjectGridLoader just to check their typeid and delete them afterwards Co-authored-by: Giacomo Pozzoni <giacomopoz@gmail.com>
Diffstat (limited to 'src/server/game/Entities/GameObject')
-rw-r--r--src/server/game/Entities/GameObject/GameObject.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp
index c5f41bae2e6..610c1730964 100644
--- a/src/server/game/Entities/GameObject/GameObject.cpp
+++ b/src/server/game/Entities/GameObject/GameObject.cpp
@@ -998,7 +998,8 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
data.spawnId = m_spawnId;
ASSERT(data.spawnId == m_spawnId);
data.id = GetEntry();
- data.spawnPoint.WorldRelocate(this);
+ data.mapId = GetMapId();
+ data.spawnPoint.Relocate(this);
data.phaseMask = phaseMask;
data.rotation = m_localRotation;
data.spawntimesecs = m_spawnedByDefault ? m_respawnDelayTime : -(int32)m_respawnDelayTime;
@@ -1115,7 +1116,7 @@ bool GameObject::LoadFromDB(ObjectGuid::LowType spawnId, Map* map, bool addToMap
SQLTransaction trans = CharacterDatabase.BeginTransaction();
- sMapMgr->DoForAllMapsWithMapId(data->spawnPoint.GetMapId(),
+ sMapMgr->DoForAllMapsWithMapId(data->mapId,
[spawnId, trans](Map* map) -> void
{
// despawn all active objects, and remove their respawns