From bc05228d9f788d0ca67dfdaba30e8e4a4c6ee61f Mon Sep 17 00:00:00 2001 From: w12x Date: Sun, 19 Oct 2008 11:07:10 -0500 Subject: [svn] Finally really fixed compile. Also, removed Unit::GetObjectInWorld(), use Map::GetCreatureInMap() and Map::GetGameObjectInMap() instead. This is to prevent creature-creature interaction on different maps, which would make the later multithreading of maps impossible. --HG-- branch : trunk --- src/game/Map.cpp | 14 ++++++++++++++ src/game/Map.h | 2 ++ src/game/Unit.cpp | 6 ------ src/game/Unit.h | 1 - 4 files changed, 16 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/game/Map.cpp b/src/game/Map.cpp index c27053b60b1..b3d41ed254d 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -1560,6 +1560,20 @@ void InstanceMap::Remove(Player *player, bool remove) Map::Remove(player, remove); } +Creature * Map::GetCreatureInMap(uint64 guid) +{ + Creature * obj = HashMapHolder::Find(guid); + if(obj && obj->GetInstanceId() != GetInstanceId()) obj = NULL; + return obj; +} + +GameObject * Map::GetGameObjectInMap(uint64 guid) +{ + GameObject * obj = HashMapHolder::Find(guid); + if(obj && obj->GetInstanceId() != GetInstanceId()) obj = NULL; + return obj; +} + void InstanceMap::CreateInstanceData(bool load) { if(i_data != NULL) diff --git a/src/game/Map.h b/src/game/Map.h index 8da3939a914..11ea7e2be61 100644 --- a/src/game/Map.h +++ b/src/game/Map.h @@ -234,6 +234,8 @@ class TRINITY_DLL_SPEC Map : public GridRefManager, public Trinity::O void resetMarkedCells() { marked_cells.reset(); } bool isCellMarked(uint32 pCellId) { return marked_cells.test(pCellId); } void markCell(uint32 pCellId) { marked_cells.set(pCellId); } + Creature* GetCreatureInMap(uint64 guid); + GameObject* GetGameObjectInMap(uint64 guid); private: void LoadVMap(int pX, int pY); void LoadMap(uint32 mapid, uint32 instanceid, int x,int y); diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 08a2ac93c92..bcac14b77aa 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -9396,12 +9396,6 @@ Unit* Unit::GetUnit(WorldObject& object, uint64 guid) return ObjectAccessor::GetUnit(object,guid); } -template T* -Unit::GetObjectInWorld(uint64 guid, T* /*fake*/) -{ - return ObjectAccessor::GetObjectInWorld(uint64 guid, T* /*fake*/); -} - bool Unit::isVisibleForInState( Player const* u, bool inVisibleList ) const { return isVisibleForOrDetect(u,false,inVisibleList); diff --git a/src/game/Unit.h b/src/game/Unit.h index 0fccbc86055..4410dd45b72 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1218,7 +1218,6 @@ class TRINITY_DLL_SPEC Unit : public WorldObject void addFollower(FollowerReference* pRef) { m_FollowingRefManager.insertFirst(pRef); } void removeFollower(FollowerReference* /*pRef*/ ) { /* nothing to do yet */ } static Unit* GetUnit(WorldObject& object, uint64 guid); - template static T* GetObjectInWorld(uint64 guid, T* /*fake*/); MotionMaster* GetMotionMaster() { return &i_motionMaster; } -- cgit v1.2.3