aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorw12x <none@none>2008-10-19 11:07:10 -0500
committerw12x <none@none>2008-10-19 11:07:10 -0500
commitbc05228d9f788d0ca67dfdaba30e8e4a4c6ee61f (patch)
treed861874f6d05aee8c0290e3b2d26b48e28c2d4a7 /src
parente78b34c63fccc5ba7e5fb7fc057d48c63876b8be (diff)
[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
Diffstat (limited to 'src')
-rw-r--r--src/game/Map.cpp14
-rw-r--r--src/game/Map.h2
-rw-r--r--src/game/Unit.cpp6
-rw-r--r--src/game/Unit.h1
4 files changed, 16 insertions, 7 deletions
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<Creature>::Find(guid);
+ if(obj && obj->GetInstanceId() != GetInstanceId()) obj = NULL;
+ return obj;
+}
+
+GameObject * Map::GetGameObjectInMap(uint64 guid)
+{
+ GameObject * obj = HashMapHolder<GameObject>::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<NGridType>, 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<class T> 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<class T> static T* GetObjectInWorld(uint64 guid, T* /*fake*/);
MotionMaster* GetMotionMaster() { return &i_motionMaster; }