*Fix a crash caused by relocationnotify

--HG--
branch : trunk
This commit is contained in:
megamage
2009-08-08 17:47:23 -05:00
parent 64ee35bd94
commit a78a0c6b01
3 changed files with 7 additions and 5 deletions

View File

@@ -649,12 +649,14 @@ void Map::AddUnitToNotify(Unit* u)
}
}
void Map::RemoveUnitFromNotify(int32 slot)
void Map::RemoveUnitFromNotify(Unit *unit, int32 slot)
{
if(i_lock)
{
assert(slot < i_unitsToNotifyBacklog.size());
i_unitsToNotifyBacklog[slot] = NULL;
if(slot < i_unitsToNotifyBacklog.size() && i_unitsToNotifyBacklog[slot] == unit)
i_unitsToNotifyBacklog[slot] = NULL;
else if(slot < i_unitsToNotify.size() && i_unitsToNotify[slot] == unit)
i_unitsToNotify[slot] = NULL;
}
else
{