diff --git a/game/debriefing.py b/game/debriefing.py index 55e066cd..8c4badb6 100644 --- a/game/debriefing.py +++ b/game/debriefing.py @@ -101,12 +101,9 @@ class StateData: #: Names of aircraft units that were killed during the mission. killed_aircraft: List[str] - #: Names of vehicle (and ship) units that were killed during the mission. + #: Names of vehicles, ships or buildings that were killed during the mission. killed_ground_units: List[str] - #: Names of map objects that were killed during the mission. - killed_map_objects: list[str] - #: List of descriptions of destroyed statics. Format of each element is a mapping of #: the coordinate type ("x", "y", "z", "type", "orientation") to the value. destroyed_statics: List[dict[str, Union[float, str]]] @@ -125,7 +122,6 @@ class StateData: # Also normalize dead map objects (which are ints) to strings. The unit map # only stores strings. killed_ground_units=list({str(u) for u in data["killed_ground_units"]}), - killed_map_objects=data["killed_map_objects"], destroyed_statics=data["destroyed_objects_positions"], base_capture_events=data["base_capture_events"], ) @@ -327,16 +323,6 @@ class Debriefing: losses.enemy_airlifts.append(airlift_unit) continue - # Find killed map objects and mark them as loss - for map_object in self.state_data.killed_map_objects: - building = self.unit_map.building_or_fortification(map_object) - if building is not None: - if building.ground_object.control_point.captured: - losses.player_buildings.append(building) - else: - losses.enemy_buildings.append(building) - continue - return losses def base_capture_events(self) -> List[BaseCaptureEvent]: diff --git a/gen/groundobjectsgen.py b/gen/groundobjectsgen.py index ce9b945e..ca9ae0e3 100644 --- a/gen/groundobjectsgen.py +++ b/gen/groundobjectsgen.py @@ -343,7 +343,7 @@ class SceneryGenerator(BuildingSiteGenerator): t = TriggerOnce(Event.NoEvent, f"MapObjectIsDead Trigger {trigger_zone.id}") t.add_condition(MapObjectIsDead(trigger_zone.id)) script_string = String( - f'killed_map_objects[#killed_map_objects + 1] = "{trigger_zone.name}"' + f'killed_ground_units[#killed_ground_units + 1] = "{trigger_zone.name}"' ) t.actions.append(DoScript(script_string)) self.m.triggerrules.triggers.append(t) diff --git a/resources/plugins/base/dcs_liberation.lua b/resources/plugins/base/dcs_liberation.lua index 9bcfb6a7..2fdc80ac 100644 --- a/resources/plugins/base/dcs_liberation.lua +++ b/resources/plugins/base/dcs_liberation.lua @@ -8,7 +8,6 @@ killed_aircrafts = {} -- killed aircraft will be added via S_EVENT_CRASH event killed_ground_units = {} -- killed units will be added via S_EVENT_DEAD event base_capture_events = {} destroyed_objects_positions = {} -- will be added via S_EVENT_DEAD event -killed_map_objects = {} -- killed map objects will be added via TriggerRules mission_ended = false local function ends_with(str, ending) @@ -36,7 +35,6 @@ function write_state() ["base_capture_events"] = base_capture_events, ["mission_ended"] = mission_ended, ["destroyed_objects_positions"] = destroyed_objects_positions, - ["killed_map_objects"] = killed_map_objects, } if not json then local message = string.format("Unable to save DCS Liberation state to %s, JSON library is not loaded !", _debriefing_file_location)