mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix incorrect value calculation of ground objects
A user would be able to sell a complete damaged TGO for the price of a new one as the value calculation function was not taking care if the unit was dead or alive. This fix now only takes alive units into account for the actual value of the tgo
This commit is contained in:
parent
4738a722a6
commit
de76276a4d
@ -218,7 +218,9 @@ class QGroundObjectMenu(QDialog):
|
|||||||
if not self.ground_object.purchasable:
|
if not self.ground_object.purchasable:
|
||||||
return
|
return
|
||||||
self.total_value = sum(
|
self.total_value = sum(
|
||||||
u.unit_type.price for u in self.ground_object.units if u.unit_type
|
u.unit_type.price
|
||||||
|
for u in self.ground_object.units
|
||||||
|
if u.unit_type and u.alive
|
||||||
)
|
)
|
||||||
if self.sell_all_button is not None:
|
if self.sell_all_button is not None:
|
||||||
self.sell_all_button.setText("Disband (+$" + str(self.total_value) + "M)")
|
self.sell_all_button.setText("Disband (+$" + str(self.total_value) + "M)")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user