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.
This commit is contained in:
Simon Clark 2021-01-30 15:00:40 +00:00
parent 8fb02136bb
commit cc3cd95e2d

View File

@ -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)