mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix helicopter spawning inside each other
Also use NoParkingSlotError for better error handling if no helipads are available
This commit is contained in:
parent
c88fa6d2af
commit
6f8c30ec81
@ -233,7 +233,7 @@ class FlightGroupSpawner:
|
|||||||
# helipad = self.helipads[cp][0]
|
# helipad = self.helipads[cp][0]
|
||||||
helipad = self.helipads[cp].pop()
|
helipad = self.helipads[cp].pop()
|
||||||
except IndexError as ex:
|
except IndexError as ex:
|
||||||
raise RuntimeError(f"Not enough helipads available at {cp}") from ex
|
raise NoParkingSlotError(f"Not enough helipads available at {cp}") from ex
|
||||||
|
|
||||||
group = self._generate_at_group(name, helipad)
|
group = self._generate_at_group(name, helipad)
|
||||||
|
|
||||||
@ -246,12 +246,14 @@ class FlightGroupSpawner:
|
|||||||
group.points[0].type = "TakeOffParkingHot"
|
group.points[0].type = "TakeOffParkingHot"
|
||||||
|
|
||||||
for i in range(self.flight.count - 1):
|
for i in range(self.flight.count - 1):
|
||||||
|
try:
|
||||||
|
helipad = self.helipads[cp].pop()
|
||||||
|
except IndexError as ex:
|
||||||
|
raise NoParkingSlotError(
|
||||||
|
f"Not enough helipads available at {cp}"
|
||||||
|
) from ex
|
||||||
group.units[1 + i].position = copy.copy(helipad.position)
|
group.units[1 + i].position = copy.copy(helipad.position)
|
||||||
group.units[1 + i].heading = helipad.units[0].heading
|
group.units[1 + i].heading = helipad.units[0].heading
|
||||||
try:
|
|
||||||
self.helipads[cp].pop()
|
|
||||||
except IndexError as ex:
|
|
||||||
raise RuntimeError(f"Not enough helipads available at {cp}") from ex
|
|
||||||
return group
|
return group
|
||||||
|
|
||||||
def dcs_start_type(self) -> DcsStartType:
|
def dcs_start_type(self) -> DcsStartType:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user