From 15fbb6f46fb24fdc6f91786543b32f247e6525fc Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 29 Oct 2014 21:13:21 +0100 Subject: Core/Entites: Updated GUID format --- src/server/game/Globals/ObjectMgr.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/server/game/Globals/ObjectMgr.cpp') diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index dd8f61fa912..a33a3cd436f 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -1381,8 +1381,8 @@ void ObjectMgr::LoadLinkedRespawn() break; } - guid = ObjectGuid(HighGuid::Creature, slave->id, guidLow); - linkedGuid = ObjectGuid(HighGuid::Creature, master->id, linkedGuidLow); + guid = ObjectGuid::Create(slave->mapid, slave->id, guidLow); + linkedGuid = ObjectGuid::Create(master->mapid, master->id, linkedGuidLow); break; } case CREATURE_TO_GO: @@ -1418,8 +1418,8 @@ void ObjectMgr::LoadLinkedRespawn() break; } - guid = ObjectGuid(HighGuid::Creature, slave->id, guidLow); - linkedGuid = ObjectGuid(HighGuid::GameObject, master->id, linkedGuidLow); + guid = ObjectGuid::Create(slave->mapid, slave->id, guidLow); + linkedGuid = ObjectGuid::Create(master->mapid, master->id, linkedGuidLow); break; } case GO_TO_GO: @@ -1455,8 +1455,8 @@ void ObjectMgr::LoadLinkedRespawn() break; } - guid = ObjectGuid(HighGuid::GameObject, slave->id, guidLow); - linkedGuid = ObjectGuid(HighGuid::GameObject, master->id, linkedGuidLow); + guid = ObjectGuid::Create(slave->mapid, slave->id, guidLow); + linkedGuid = ObjectGuid::Create(master->mapid, master->id, linkedGuidLow); break; } case GO_TO_CREATURE: @@ -1492,8 +1492,8 @@ void ObjectMgr::LoadLinkedRespawn() break; } - guid = ObjectGuid(HighGuid::GameObject, slave->id, guidLow); - linkedGuid = ObjectGuid(HighGuid::Creature, master->id, linkedGuidLow); + guid = ObjectGuid::Create(slave->mapid, slave->id, guidLow); + linkedGuid = ObjectGuid::Create(master->mapid, master->id, linkedGuidLow); break; } } @@ -1513,7 +1513,7 @@ bool ObjectMgr::SetCreatureLinkedRespawn(ObjectGuid::LowType guidLow, ObjectGuid CreatureData const* master = GetCreatureData(guidLow); ASSERT(master); - ObjectGuid guid(HighGuid::Creature, master->id, guidLow); + ObjectGuid guid = ObjectGuid::Create(master->mapid, master->id, guidLow); if (!linkedGuidLow) // we're removing the linking { @@ -1544,7 +1544,7 @@ bool ObjectMgr::SetCreatureLinkedRespawn(ObjectGuid::LowType guidLow, ObjectGuid return false; } - ObjectGuid linkedGuid(HighGuid::Creature, slave->id, linkedGuidLow); + ObjectGuid linkedGuid = ObjectGuid::Create(slave->mapid, slave->id, linkedGuidLow); _linkedRespawnStore[guid] = linkedGuid; PreparedStatement *stmt = WorldDatabase.GetPreparedStatement(WORLD_REP_CREATURE_LINKED_RESPAWN); @@ -2177,7 +2177,7 @@ void ObjectMgr::RemoveGameobjectFromGrid(ObjectGuid::LowType guid, GameObjectDat Player* ObjectMgr::GetPlayerByLowGUID(ObjectGuid::LowType lowguid) const { - return ObjectAccessor::FindPlayer(ObjectGuid(HighGuid::Player, lowguid)); + return ObjectAccessor::FindPlayer(ObjectGuid::Create(lowguid)); } // name must be checked to correctness (if received) before call this function @@ -2190,7 +2190,7 @@ ObjectGuid ObjectMgr::GetPlayerGUIDByName(std::string const& name) const PreparedQueryResult result = CharacterDatabase.Query(stmt); if (result) - return ObjectGuid(HighGuid::Player, (*result)[0].GetUInt64()); + return ObjectGuid::Create((*result)[0].GetUInt64()); return ObjectGuid::Empty; } @@ -5584,7 +5584,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp) Player* player = NULL; if (serverUp) - player = ObjectAccessor::FindConnectedPlayer(ObjectGuid(HighGuid::Player, m->receiver)); + player = ObjectAccessor::FindConnectedPlayer(ObjectGuid::Create(m->receiver)); if (player && player->m_mailsLoaded) { // this code will run very improbably (the time is between 4 and 5 am, in game is online a player, who has old mail -- cgit v1.2.3