diff options
author | Carbenium <carbenium@outlook.com> | 2015-09-23 20:21:20 +0200 |
---|---|---|
committer | Carbenium <carbenium@outlook.com> | 2015-09-23 20:21:20 +0200 |
commit | ff31a1d9eddccca5f8077bb35cd5a7f7740f467d (patch) | |
tree | 93a1bc20a25da58e73f356c8dfa14b4b07154748 /src/server/game/Chat/Chat.cpp | |
parent | d476e0eff24af5849bbbc21128aa461a24d4fe9b (diff) | |
parent | dcb7082277447c21b11c4a1d59f105fa342c172e (diff) |
Merge pull request #15313 from pete318/map_local_guid_335
[3.3.5/Core/Map] map local guids 6.x -> 3.3.5
Diffstat (limited to 'src/server/game/Chat/Chat.cpp')
-rw-r--r-- | src/server/game/Chat/Chat.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index 0d6816fc80d..2f003a58a69 100644 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -917,19 +917,15 @@ GameObject* ChatHandler::GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid Player* pl = m_session->GetPlayer(); - GameObject* obj = pl->GetMap()->GetGameObject(ObjectGuid(HIGHGUID_GAMEOBJECT, entry, lowguid)); + GameObject* obj = pl->GetMap()->GetGameObject(ObjectGuid(HighGuid::GameObject, entry, lowguid)); if (!obj && sObjectMgr->GetGOData(lowguid)) // guid is DB guid of object { - // search near player then - CellCoord p(Trinity::ComputeCellCoord(pl->GetPositionX(), pl->GetPositionY())); - Cell cell(p); + auto bounds = pl->GetMap()->GetGameObjectBySpawnIdStore().equal_range(lowguid); + if (bounds.first == bounds.second) + return nullptr; - Trinity::GameObjectWithDbGUIDCheck go_check(*pl, lowguid); - Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck> checker(pl, obj, go_check); - - TypeContainerVisitor<Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck>, GridTypeMapContainer > object_checker(checker); - cell.Visit(p, object_checker, *pl->GetMap(), *pl, pl->GetGridActivationRange()); + return bounds.first->second; } return obj; @@ -1067,7 +1063,7 @@ ObjectGuid ChatHandler::extractGuidFromLink(char* text) uint32 lowguid = atoul(idS); if (CreatureData const* data = sObjectMgr->GetCreatureData(lowguid)) - return ObjectGuid(HIGHGUID_UNIT, data->id, lowguid); + return ObjectGuid(HighGuid::Unit, data->id, lowguid); else return ObjectGuid::Empty; } @@ -1076,7 +1072,7 @@ ObjectGuid ChatHandler::extractGuidFromLink(char* text) uint32 lowguid = atoul(idS); if (GameObjectData const* data = sObjectMgr->GetGOData(lowguid)) - return ObjectGuid(HIGHGUID_GAMEOBJECT, data->id, lowguid); + return ObjectGuid(HighGuid::GameObject, data->id, lowguid); else return ObjectGuid::Empty; } |