diff options
author | Shauren <shauren.trinity@gmail.com> | 2014-09-14 16:14:12 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2014-09-14 16:14:12 +0200 |
commit | a0e50ea35fca61447bf07fc45d93c98234ba59f7 (patch) | |
tree | b4ee69a63866f42e466a3c03fc031ce0710ac762 /src/server/game/Maps/Map.cpp | |
parent | ce67a097bf3c0c3241f4441a808e32639ddbaafb (diff) |
Core/Entities: Use ObjectGuid class in game project
Diffstat (limited to 'src/server/game/Maps/Map.cpp')
-rw-r--r-- | src/server/game/Maps/Map.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 9e29fb01c3b..d5af7f80c49 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -534,7 +534,7 @@ bool Map::AddToMap(T* obj) else EnsureGridCreated(GridCoord(cell.GridX(), cell.GridY())); AddToGrid(obj, cell); - TC_LOG_DEBUG("maps", "Object %u enters grid[%u, %u]", GUID_LOPART(obj->GetGUID()), cell.GridX(), cell.GridY()); + TC_LOG_DEBUG("maps", "Object %s enters grid[%u, %u]", obj->GetGUID().ToString().c_str(), cell.GridX(), cell.GridY()); //Must already be set before AddToMap. Usually during obj->Create. //obj->SetMap(this); @@ -2942,7 +2942,7 @@ bool InstanceMap::AddPlayerToMap(Player* player) InstanceGroupBind* groupBind = group->GetBoundInstance(this); if (playerBind && playerBind->save != mapSave) { - TC_LOG_ERROR("maps", "InstanceMap::Add: player %s(%d) is being put into instance %s %d, %d, %d, %d, %d, %d but he is in group %d and is bound to instance %d, %d, %d, %d, %d, %d!", player->GetName().c_str(), player->GetGUIDLow(), GetMapName(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), mapSave->GetPlayerCount(), mapSave->GetGroupCount(), mapSave->CanReset(), GUID_LOPART(group->GetLeaderGUID()), playerBind->save->GetMapId(), playerBind->save->GetInstanceId(), playerBind->save->GetDifficulty(), playerBind->save->GetPlayerCount(), playerBind->save->GetGroupCount(), playerBind->save->CanReset()); + TC_LOG_ERROR("maps", "InstanceMap::Add: player %s(%d) is being put into instance %s %d, %d, %d, %d, %d, %d but he is in group %d and is bound to instance %d, %d, %d, %d, %d, %d!", player->GetName().c_str(), player->GetGUIDLow(), GetMapName(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), mapSave->GetPlayerCount(), mapSave->GetGroupCount(), mapSave->CanReset(), group->GetLeaderGUID().GetCounter(), playerBind->save->GetMapId(), playerBind->save->GetInstanceId(), playerBind->save->GetDifficulty(), playerBind->save->GetPlayerCount(), playerBind->save->GetGroupCount(), playerBind->save->CanReset()); if (groupBind) TC_LOG_ERROR("maps", "InstanceMap::Add: the group is bound to the instance %s %d, %d, %d, %d, %d, %d", GetMapName(), groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty(), groupBind->save->GetPlayerCount(), groupBind->save->GetGroupCount(), groupBind->save->CanReset()); //ASSERT(false); @@ -2956,7 +2956,7 @@ bool InstanceMap::AddPlayerToMap(Player* player) // cannot jump to a different instance without resetting it if (groupBind->save != mapSave) { - TC_LOG_ERROR("maps", "InstanceMap::Add: player %s(%d) is being put into instance %d, %d, %d but he is in group %d which is bound to instance %d, %d, %d!", player->GetName().c_str(), player->GetGUIDLow(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), GUID_LOPART(group->GetLeaderGUID()), groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty()); + TC_LOG_ERROR("maps", "InstanceMap::Add: player %s(%d) is being put into instance %d, %d, %d but he is in group %d which is bound to instance %d, %d, %d!", player->GetName().c_str(), player->GetGUIDLow(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), group->GetLeaderGUID().GetCounter(), groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty()); TC_LOG_ERROR("maps", "MapSave players: %d, group count: %d", mapSave->GetPlayerCount(), mapSave->GetGroupCount()); if (groupBind->save) TC_LOG_ERROR("maps", "GroupBind save players: %d, group count: %d", groupBind->save->GetPlayerCount(), groupBind->save->GetGroupCount()); @@ -3270,26 +3270,26 @@ void BattlegroundMap::RemoveAllPlayers() player->TeleportTo(player->GetBattlegroundEntryPoint()); } -Creature* Map::GetCreature(uint64 guid) +Creature* Map::GetCreature(ObjectGuid guid) { return ObjectAccessor::GetObjectInMap(guid, this, (Creature*)NULL); } -GameObject* Map::GetGameObject(uint64 guid) +GameObject* Map::GetGameObject(ObjectGuid guid) { return ObjectAccessor::GetObjectInMap(guid, this, (GameObject*)NULL); } -Transport* Map::GetTransport(uint64 guid) +Transport* Map::GetTransport(ObjectGuid guid) { - if (GUID_HIPART(guid) != HIGHGUID_MO_TRANSPORT) + if (!guid.IsMOTransport()) return NULL; GameObject* go = GetGameObject(guid); return go ? go->ToTransport() : NULL; } -DynamicObject* Map::GetDynamicObject(uint64 guid) +DynamicObject* Map::GetDynamicObject(ObjectGuid guid) { return ObjectAccessor::GetObjectInMap(guid, this, (DynamicObject*)NULL); } @@ -3414,15 +3414,15 @@ void Map::DeleteRespawnTimesInDB(uint16 mapId, uint32 instanceId) CharacterDatabase.Execute(stmt); } -time_t Map::GetLinkedRespawnTime(uint64 guid) const +time_t Map::GetLinkedRespawnTime(ObjectGuid guid) const { - uint64 linkedGuid = sObjectMgr->GetLinkedRespawnGuid(guid); - switch (GUID_HIPART(linkedGuid)) + ObjectGuid linkedGuid = sObjectMgr->GetLinkedRespawnGuid(guid); + switch (linkedGuid.GetHigh()) { case HIGHGUID_UNIT: - return GetCreatureRespawnTime(GUID_LOPART(linkedGuid)); + return GetCreatureRespawnTime(linkedGuid.GetCounter()); case HIGHGUID_GAMEOBJECT: - return GetGORespawnTime(GUID_LOPART(linkedGuid)); + return GetGORespawnTime(linkedGuid.GetCounter()); default: break; } |