Fix incorrect handling of disabled groups in buy menu

Disabled groups would still be bought free of charge. this is now fixed
This commit is contained in:
RndName 2022-05-04 21:26:49 +02:00
parent 321bd4e874
commit 015103f613
No known key found for this signature in database
GPG Key ID: 5EF516FD9537F7C0

View File

@ -222,14 +222,15 @@ class QGroundObjectTemplateLayout(QGroupBox):
self.ground_object.groups = []
for group_name, groups in self.layout_model.groups.items():
for group in groups:
self.layout_model.force_group.create_theater_group_for_tgo(
self.ground_object,
group.layout,
f"{self.ground_object.name} ({group_name})",
self.game,
group.dcs_unit_type, # Forced Type
group.amount, # Forced Amount
)
if group.enabled:
self.layout_model.force_group.create_theater_group_for_tgo(
self.ground_object,
group.layout,
f"{self.ground_object.name} ({group_name})",
self.game,
group.dcs_unit_type, # Forced Type
group.amount, # Forced Amount
)
self.close_dialog_signal.emit()