fixed naval intercept crash; fixed wrong targets order; fixed initial waypoint being WP #1; m2k a2g ccip; fixed time being time zone offset ahead; lowered rain weather chance

This commit is contained in:
Vasyl Horbachenko
2018-10-13 04:41:18 +03:00
parent 4fc766a524
commit 397f9a58cb
9 changed files with 21 additions and 16 deletions

View File

@@ -371,7 +371,7 @@ PLANE_PAYLOAD_OVERRIDES = {
M_2000C: {
CAP: "Combat Air Patrol",
GroundAttack: "MK-82 Heavy Strike",
GroundAttack: "MK-82S Heavy Strike",
},
MiG_21Bis: {

View File

@@ -50,7 +50,7 @@ class NavalInterceptionOperation(Operation):
self.briefinggen.title = "Naval Intercept"
if self.game.player == self.attacker_name:
self.briefinggen.description = "Destroy supply transport ships. Lowers target strength. Be advised that your flight will not attack anything until you explicitly tell them so by comms menu."
for unit_type, count in self.targets:
for unit_type, count in self.targets.items():
self.briefinggen.append_target("{} ({})".format(db.unit_type_name(unit_type), count))
else:
self.briefinggen.description = "Protect supply transport ships."

View File

@@ -46,7 +46,7 @@ class StrikeOperation(Operation):
if global_cp == self.from_cp and not self.is_quick:
self.attackers_starting_position = ship
targets = [] # type: typing.List[typing.Tuple[str, Point]]
targets = [] # type: typing.List[typing.Tuple[str, str, Point]]
category_counters = {} # type: typing.Dict[str, int]
processed_groups = []
for object in self.to_cp.ground_objects:
@@ -56,16 +56,16 @@ class StrikeOperation(Operation):
processed_groups.append(object.group_identifier)
category_counters[object.category] = category_counters.get(object.category, 0) + 1
markpoint_name = "{}{}".format(object.name_abbrev, category_counters[object.category])
targets.append((markpoint_name, object.position))
targets.append((str(object), markpoint_name, object.position))
targets.sort(key=lambda x: self.from_cp.position.distance_to_point(x[1]))
targets.sort(key=lambda x: self.from_cp.position.distance_to_point(x[2]))
for (name, markpoint_name) in targets:
for (name, markpoint_name, _) in targets:
self.briefinggen.append_waypoint("TARGET {} (TP {})".format(str(name), markpoint_name))
planes_flights = {k: v for k, v in self.strikegroup.items() if k in plane_map.values()}
self.airgen.generate_ground_attack_strikegroup(*assigned_units_split(planes_flights),
targets=targets,
targets=[(mp, pos) for (n, mp, pos) in targets],
at=self.attackers_starting_position)
heli_flights = {k: v for k, v in self.strikegroup.items() if k in helicopters.helicopter_map.values()}
@@ -74,7 +74,7 @@ class StrikeOperation(Operation):
for farp, dict in zip(self.groundobjectgen.generate_farps(sum([x[0] for x in heli_flights.values()])),
db.assignedunits_split_to_count(heli_flights, self.groundobjectgen.FARP_CAPACITY)):
self.airgen.generate_ground_attack_strikegroup(*assigned_units_split(dict),
targets=targets,
targets=[(mp, pos) for (n, mp, pos) in targets],
at=farp,
escort=len(planes_flights) == 0)