diff options
author | megamage <none@none> | 2009-08-08 17:47:23 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-08-08 17:47:23 -0500 |
commit | a78a0c6b0175aeec85ed3a53ddb52dcf5eeebdcf (patch) | |
tree | c46b83a98a3ef51755b71b68a80a61e144f0d0b6 /src/game/Map.cpp | |
parent | 64ee35bd94d70872d404c23094f96962fe8f6114 (diff) |
*Fix a crash caused by relocationnotify
--HG--
branch : trunk
Diffstat (limited to 'src/game/Map.cpp')
-rw-r--r-- | src/game/Map.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/game/Map.cpp b/src/game/Map.cpp index 85a720948ab..47925102892 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -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 { |