Merge pull request #10636 from jackpoz/mindvision_fix

Core/Aura: Fix SPELL_AURA_BIND_SIGHT invalid read
This commit is contained in:
Shauren
2013-08-26 08:23:44 -07:00

View File

@@ -2114,6 +2114,10 @@ void Map::AddObjectToRemoveList(WorldObject* obj)
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)
return;
std::map<WorldObject*, bool>::iterator itr = i_objectsToSwitch.find(obj);
if (itr == i_objectsToSwitch.end())