mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Fixed possible crash in mission generation when generating a mission with a faction that doesn't have mandpad and with the disabled infantry option checked.
(cherry picked from commit 31fdd24c3e21aade0abce94dbec7e0df4b61026b)
This commit is contained in:
parent
0f1577d314
commit
e134143f16
18
gen/armor.py
18
gen/armor.py
@ -201,14 +201,16 @@ class GroundConflictGenerator:
|
|||||||
if self.game.settings.manpads:
|
if self.game.settings.manpads:
|
||||||
# 50% of armored units protected by manpad
|
# 50% of armored units protected by manpad
|
||||||
if random.choice([True, False]):
|
if random.choice([True, False]):
|
||||||
u = random.choice(db.find_manpad(faction))
|
manpads = db.find_manpad(faction)
|
||||||
self.mission.vehicle_group(
|
if len(manpads) > 0:
|
||||||
side,
|
u = random.choice(manpads)
|
||||||
namegen.next_infantry_name(side, cp, u), u,
|
self.mission.vehicle_group(
|
||||||
position=infantry_position,
|
side,
|
||||||
group_size=1,
|
namegen.next_infantry_name(side, cp, u), u,
|
||||||
heading=forward_heading,
|
position=infantry_position,
|
||||||
move_formation=PointAction.OffRoad)
|
group_size=1,
|
||||||
|
heading=forward_heading,
|
||||||
|
move_formation=PointAction.OffRoad)
|
||||||
return
|
return
|
||||||
|
|
||||||
possible_infantry_units = db.find_infantry(faction, allow_manpad=self.game.settings.manpads)
|
possible_infantry_units = db.find_infantry(faction, allow_manpad=self.game.settings.manpads)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user