Core/Maps: Added gameobject case for AddObjectToSwitchList and fixed logic in RemoveAllObjectsInRemoveList
This commit is contained in:
1 parent
77013aa081
commit
38b682d7a8
1 file changed
+2
-2
@@ -2396,7 +2396,7 @@ void Map::AddObjectToSwitchList(WorldObject* obj, bool on)
|
||||
ASSERT(obj->GetMapId() == GetId() && obj->GetInstanceId() == GetInstanceId());
|
||||
// i_objectsToSwitch is iterated only in Map::RemoveAllObjectsInRemoveList() and it uses
|
||||
// the contained objects only if GetTypeId() == TYPEID_UNIT , so we can return in all other cases
|
||||
if (obj->GetTypeId() != TYPEID_UNIT)
|
||||
if (obj->GetTypeId() != TYPEID_UNIT && obj->GetTypeId() != TYPEID_GAMEOBJECT)
|
||||
return;
|
||||
|
||||
std::map<WorldObject*, bool>::iterator itr = i_objectsToSwitch.find(obj);
|
||||
@@ -2417,7 +2417,7 @@ void Map::RemoveAllObjectsInRemoveList()
|
||||
bool on = itr->second;
|
||||
i_objectsToSwitch.erase(itr);
|
||||
|
||||
if (obj->GetTypeId() == TYPEID_UNIT || obj->GetTypeId() == TYPEID_GAMEOBJECT && !obj->IsPermanentWorldObject())
|
||||
if ((obj->GetTypeId() == TYPEID_UNIT || obj->GetTypeId() == TYPEID_GAMEOBJECT) && !obj->IsPermanentWorldObject())
|
||||
SwitchGridContainers(obj, on);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user