Previously destroyed units are added to the mission.

This commit is contained in:
Khopa
2020-07-25 18:46:10 +02:00
parent b34ede3795
commit d5fb1f62f5
9 changed files with 197 additions and 41 deletions

View File

@@ -123,6 +123,21 @@ class Operation:
# Generate ground object first
self.groundobjectgen.generate()
# Generate destroyed units
for d in self.game.get_destroyed_units():
utype = db.unit_type_from_name(d["type"])
pos = Point(d["x"], d["z"])
if utype is not None and not self.game.position_culled(pos):
self.current_mission.static_group(
country=self.current_mission.country(self.game.player_country),
name="",
_type=utype,
hidden=True,
position=pos,
heading=d["orientation"],
dead=True,
)
# Air Support (Tanker & Awacs)
self.airsupportgen.generate(self.is_awacs_enabled)