mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Restore theater ground objects to full health when repairing via UI (#3506)
This commit is contained in:
parent
43be243711
commit
3ed1f20233
@ -9,6 +9,7 @@ Saves from 13.x are not compatible with 14.0.0.
|
||||
## Fixes
|
||||
|
||||
* **[UI]** Air Wing and Transfers buttons disabled when no game is loaded as pressing them without a game loaded resulted in a crash.
|
||||
* **[UI]** Units are restored to full health when repaired.
|
||||
|
||||
# 13.0.0
|
||||
|
||||
|
||||
@ -23,6 +23,7 @@ from game.theater import ControlPoint, TheaterGroundObject
|
||||
from game.theater.theatergroundobject import (
|
||||
BuildingGroundObject,
|
||||
)
|
||||
from game.theater.theatergroup import TheaterUnit
|
||||
from game.utils import Heading
|
||||
from qt_ui.uiconstants import EVENT_ICONS, ICONS
|
||||
from qt_ui.widgets.QBudgetBox import QBudgetBox
|
||||
@ -229,10 +230,11 @@ class QGroundObjectMenu(QDialog):
|
||||
if self.sell_all_button is not None:
|
||||
self.sell_all_button.setText("Disband (+$" + str(self.total_value) + "M)")
|
||||
|
||||
def repair_unit(self, unit, price):
|
||||
def repair_unit(self, unit: TheaterUnit, price: float):
|
||||
if self.game.blue.budget > price:
|
||||
self.game.blue.budget -= price
|
||||
unit.alive = True
|
||||
unit.hit_points = unit.unit_type.hit_points # Restore unit health to full
|
||||
GameUpdateSignal.get_instance().updateGame(self.game)
|
||||
|
||||
# Remove destroyed units in the vicinity
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user