mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix for incorrect unit_count in layout
- Raise LayoutException if the unit_count in the layout is greater than the available units - Fix Flak Layout to solve #2043
This commit is contained in:
parent
c238e50e41
commit
46694e458d
@ -129,6 +129,10 @@ class TgoLayoutGroup:
|
||||
self, go: TheaterGroundObject, unit_type: Type[DcsUnitType], amount: int
|
||||
) -> list[TheaterUnit]:
|
||||
"""Generate units of the given unit type and amount for the TgoLayoutGroup"""
|
||||
if amount > len(self.layout_units):
|
||||
raise LayoutException(
|
||||
f"{self.name} has incorrect unit_count for {unit_type.id}"
|
||||
)
|
||||
return [
|
||||
TheaterUnit.from_template(i, unit_type, self.layout_units[i], go)
|
||||
for i in range(amount)
|
||||
|
||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user