mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Fix selling of units not visible
allow pending_deliveries to become negative again but still delete the delivery when the amount of a specific unit_type comes to exactly 0 to prevent emtpy group sizes (cherry picked from ee8e8d4)
This commit is contained in:
parent
7754e5fd4d
commit
6febf546a8
@ -8,6 +8,8 @@ Saves from 4.1.1 are compatible with 4.1.2.
|
||||
|
||||
## Fixes
|
||||
|
||||
* **[UI]** Selling of Units is now visible again in the UI dialog and shows the correct amount of sold units
|
||||
|
||||
# 4.1.1
|
||||
|
||||
Saves from 4.1.0 are compatible with 4.1.1.
|
||||
|
||||
@ -39,9 +39,8 @@ class PendingUnitDeliveries:
|
||||
|
||||
def sell(self, units: dict[UnitType[Any], int]) -> None:
|
||||
for k, v in units.items():
|
||||
if self.units[k] > v:
|
||||
self.units[k] -= v
|
||||
else:
|
||||
self.units[k] -= v
|
||||
if self.units[k] == 0:
|
||||
del self.units[k]
|
||||
|
||||
def refund_all(self, game: Game) -> None:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user