Changeset 61

Show
Ignore:
Timestamp:
11/19/08 13:30:29 (17 years ago)
Author:
yumileroy
Message:

[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.

Original author: w12x
Date: 2008-10-19 11:07:10-05:00

Location:
trunk/src/game
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/Map.cpp

    r44 r61  
    15611561} 
    15621562 
     1563Creature * Map::GetCreatureInMap(uint64 guid) 
     1564{ 
     1565    Creature * obj = HashMapHolder<Creature>::Find(guid); 
     1566    if(obj && obj->GetInstanceId() != GetInstanceId()) obj = NULL; 
     1567    return obj; 
     1568} 
     1569 
     1570GameObject * Map::GetGameObjectInMap(uint64 guid) 
     1571{ 
     1572    GameObject * obj = HashMapHolder<GameObject>::Find(guid); 
     1573    if(obj && obj->GetInstanceId() != GetInstanceId()) obj = NULL; 
     1574    return obj; 
     1575} 
     1576 
    15631577void InstanceMap::CreateInstanceData(bool load) 
    15641578{ 
  • trunk/src/game/Map.h

    r44 r61  
    235235        bool isCellMarked(uint32 pCellId) { return marked_cells.test(pCellId); } 
    236236        void markCell(uint32 pCellId) { marked_cells.set(pCellId); } 
     237        Creature* GetCreatureInMap(uint64 guid); 
     238        GameObject* GetGameObjectInMap(uint64 guid); 
    237239    private: 
    238240        void LoadVMap(int pX, int pY); 
  • trunk/src/game/Unit.cpp

    r60 r61  
    93979397} 
    93989398 
    9399 template<class T> T* 
    9400 Unit::GetObjectInWorld(uint64 guid, T* /*fake*/) 
    9401 { 
    9402     return ObjectAccessor::GetObjectInWorld(uint64 guid, T* /*fake*/); 
    9403 } 
    9404  
    94059399bool Unit::isVisibleForInState( Player const* u, bool inVisibleList ) const 
    94069400{ 
  • trunk/src/game/Unit.h

    r59 r61  
    12191219        void removeFollower(FollowerReference* /*pRef*/ ) { /* nothing to do yet */ } 
    12201220        static Unit* GetUnit(WorldObject& object, uint64 guid); 
    1221         template<class T> static T* GetObjectInWorld(uint64 guid, T* /*fake*/); 
    12221221 
    12231222        MotionMaster* GetMotionMaster() { return &i_motionMaster; }