From 015103f613495613d623ee7821784b3cfc03e7c4 Mon Sep 17 00:00:00 2001 From: RndName Date: Wed, 4 May 2022 21:26:49 +0200 Subject: [PATCH] Fix incorrect handling of disabled groups in buy menu Disabled groups would still be bought free of charge. this is now fixed --- .../groundobject/QGroundObjectBuyMenu.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/qt_ui/windows/groundobject/QGroundObjectBuyMenu.py b/qt_ui/windows/groundobject/QGroundObjectBuyMenu.py index 3e9cbcf6..b0286fe0 100644 --- a/qt_ui/windows/groundobject/QGroundObjectBuyMenu.py +++ b/qt_ui/windows/groundobject/QGroundObjectBuyMenu.py @@ -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()