diff options
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 { |