mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix unit list for non-building TGOs.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1082
This commit is contained in:
parent
5d9563304f
commit
51d557524d
@ -201,15 +201,18 @@ class GroundObjectJs(QObject):
|
||||
@Property(list, notify=unitsChanged)
|
||||
def units(self) -> List[str]:
|
||||
units = []
|
||||
if self.buildings:
|
||||
for building in self.buildings:
|
||||
dead = " [DEAD]" if building.is_dead else ""
|
||||
units.append(f"{building.dcs_identifier}{dead}")
|
||||
else:
|
||||
# TGOs with a non-empty group set are non-building TGOs. Building TGOs have no
|
||||
# groups set, but instead are one TGO per building "group" (DCS doesn't support
|
||||
# groups of statics) all with the same name.
|
||||
if self.tgo.groups:
|
||||
for unit in self.tgo.units:
|
||||
units.append(self.make_unit_name(unit, dead=False))
|
||||
for unit in self.tgo.dead_units:
|
||||
units.append(self.make_unit_name(unit, dead=True))
|
||||
else:
|
||||
for building in self.buildings:
|
||||
dead = " [DEAD]" if building.is_dead else ""
|
||||
units.append(f"{building.dcs_identifier}{dead}")
|
||||
return units
|
||||
|
||||
@Property(bool, notify=blueChanged)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user