[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
This commit is contained in:
w12x
2008-10-19 11:07:10 -05:00
parent e78b34c63f
commit bc05228d9f
4 changed files with 16 additions and 7 deletions

View File

@@ -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)

View File

@@ -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);

View File

@@ -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);

View File

@@ -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; }