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 | |
| parent | ce67a097bf3c0c3241f4441a808e32639ddbaafb (diff) | |
Core/Entities: Use ObjectGuid class in game project
Diffstat (limited to 'src/server/game/Maps')
| -rw-r--r-- | src/server/game/Maps/Map.cpp | 26 | ||||
| -rw-r--r-- | src/server/game/Maps/Map.h | 16 |
2 files changed, 21 insertions, 21 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; } diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index fd9ec281709..926752f4be8 100644 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -56,9 +56,9 @@ namespace Trinity { struct ObjectUpdater; } struct ScriptAction { - uint64 sourceGUID; - uint64 targetGUID; - uint64 ownerGUID; ///> owner of source if source is item + ObjectGuid sourceGUID; + ObjectGuid targetGUID; + ObjectGuid ownerGUID; ///> owner of source if source is item ScriptInfo const* script; ///> pointer to static script data }; @@ -451,10 +451,10 @@ class Map : public GridRefManager<NGridType> TempSummon* SummonCreature(uint32 entry, Position const& pos, SummonPropertiesEntry const* properties = NULL, uint32 duration = 0, Unit* summoner = NULL, uint32 spellId = 0, uint32 vehId = 0); void SummonCreatureGroup(uint8 group, std::list<TempSummon*>* list = NULL); - Creature* GetCreature(uint64 guid); - GameObject* GetGameObject(uint64 guid); - Transport* GetTransport(uint64 guid); - DynamicObject* GetDynamicObject(uint64 guid); + Creature* GetCreature(ObjectGuid guid); + GameObject* GetGameObject(ObjectGuid guid); + Transport* GetTransport(ObjectGuid guid); + DynamicObject* GetDynamicObject(ObjectGuid guid); MapInstanced* ToMapInstanced() { if (Instanceable()) return reinterpret_cast<MapInstanced*>(this); return NULL; } MapInstanced const* ToMapInstanced() const { if (Instanceable()) return reinterpret_cast<MapInstanced const*>(this); return NULL; } @@ -477,7 +477,7 @@ class Map : public GridRefManager<NGridType> /* RESPAWN TIMES */ - time_t GetLinkedRespawnTime(uint64 guid) const; + time_t GetLinkedRespawnTime(ObjectGuid guid) const; time_t GetCreatureRespawnTime(uint32 dbGuid) const { std::unordered_map<uint32 /*dbGUID*/, time_t>::const_iterator itr = _creatureRespawnTimes.find(dbGuid); |
