diff --git a/changelog.md b/changelog.md index 20fa87d7..abc4373e 100644 --- a/changelog.md +++ b/changelog.md @@ -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. diff --git a/game/unitdelivery.py b/game/unitdelivery.py index 258ea409..cc4e0329 100644 --- a/game/unitdelivery.py +++ b/game/unitdelivery.py @@ -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: