From cc3cd95e2def59f7dd32e434bd37a3f604bf7dd5 Mon Sep 17 00:00:00 2001 From: Simon Clark Date: Sat, 30 Jan 2021 15:00:40 +0000 Subject: [PATCH] Test for unit_name + " object" in the debrief. This is because all building objects have " object" appended to the end in the unit map, but not in the state.json. Therefore, we should now find destroyed building objects in the unit map. Should fix #793. --- game/debriefing.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/game/debriefing.py b/game/debriefing.py index 2bf879c6..ab4e742e 100644 --- a/game/debriefing.py +++ b/game/debriefing.py @@ -197,6 +197,9 @@ class Debriefing: continue building = self.unit_map.building_or_fortification(unit_name) + # Try appending object to the name, because we do this for building statics. + if building is None: + building = self.unit_map.building_or_fortification(unit_name + " object") if building is not None: if building.ground_object.control_point.captured: losses.player_buildings.append(building)