mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix too many ground spawns being popped
This commit is contained in:
parent
0ecbd81a20
commit
8bc902fe64
@ -496,21 +496,20 @@ class FlightGroupSpawner:
|
|||||||
) -> Optional[FlyingGroup[Any]]:
|
) -> Optional[FlyingGroup[Any]]:
|
||||||
is_airbase = False
|
is_airbase = False
|
||||||
is_roadbase = False
|
is_roadbase = False
|
||||||
|
ground_spawn = None
|
||||||
|
|
||||||
try:
|
if not is_large and len(self.ground_spawns_roadbase[cp]) > 0:
|
||||||
if is_large:
|
ground_spawn = self.ground_spawns_roadbase[cp].pop()
|
||||||
if len(self.ground_spawns_large[cp]) > 0:
|
is_roadbase = True
|
||||||
ground_spawn = self.ground_spawns_large[cp].pop()
|
elif not is_large and len(self.ground_spawns[cp]) > 0:
|
||||||
is_airbase = True
|
ground_spawn = self.ground_spawns[cp].pop()
|
||||||
else:
|
is_airbase = True
|
||||||
if len(self.ground_spawns_roadbase[cp]) > 0:
|
elif len(self.ground_spawns_large[cp]) > 0:
|
||||||
ground_spawn = self.ground_spawns_roadbase[cp].pop()
|
ground_spawn = self.ground_spawns_large[cp].pop()
|
||||||
is_roadbase = True
|
is_airbase = True
|
||||||
if len(self.ground_spawns[cp]) > 0:
|
|
||||||
ground_spawn = self.ground_spawns[cp].pop()
|
if ground_spawn is None:
|
||||||
is_airbase = True
|
logging.warning("Not enough ground spawn slots available at " + cp.name)
|
||||||
except IndexError as ex:
|
|
||||||
logging.warning("Not enough ground spawn slots available at " + str(ex))
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
group = self._generate_at_group(name, ground_spawn[0])
|
group = self._generate_at_group(name, ground_spawn[0])
|
||||||
@ -547,14 +546,12 @@ class FlightGroupSpawner:
|
|||||||
for i in range(self.flight.count - 1):
|
for i in range(self.flight.count - 1):
|
||||||
try:
|
try:
|
||||||
terrain = cp.coalition.game.theater.terrain
|
terrain = cp.coalition.game.theater.terrain
|
||||||
if is_large:
|
if not is_large and len(self.ground_spawns_roadbase[cp]) > 0:
|
||||||
if len(self.ground_spawns_large[cp]) > 0:
|
ground_spawn = self.ground_spawns_roadbase[cp].pop()
|
||||||
ground_spawn = self.ground_spawns_large[cp].pop()
|
elif not is_large and len(self.ground_spawns[cp]) > 0:
|
||||||
else:
|
ground_spawn = self.ground_spawns[cp].pop()
|
||||||
if len(self.ground_spawns_roadbase[cp]) > 0:
|
elif len(self.ground_spawns_large[cp]) > 0:
|
||||||
ground_spawn = self.ground_spawns_roadbase[cp].pop()
|
ground_spawn = self.ground_spawns_large[cp].pop()
|
||||||
else:
|
|
||||||
ground_spawn = self.ground_spawns[cp].pop()
|
|
||||||
group.units[1 + i].position = Point(
|
group.units[1 + i].position = Point(
|
||||||
ground_spawn[0].x, ground_spawn[0].y, terrain=terrain
|
ground_spawn[0].x, ground_spawn[0].y, terrain=terrain
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user