mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
remove completely destroyed units from the convoy
(cherry picked from commit 8ba27cdaea)
This commit is contained in:
@@ -99,7 +99,10 @@ class TransferOrder:
|
|||||||
def kill_unit(self, unit_type: GroundUnitType) -> None:
|
def kill_unit(self, unit_type: GroundUnitType) -> None:
|
||||||
if unit_type not in self.units or not self.units[unit_type]:
|
if unit_type not in self.units or not self.units[unit_type]:
|
||||||
raise KeyError(f"{self} has no {unit_type} remaining")
|
raise KeyError(f"{self} has no {unit_type} remaining")
|
||||||
self.units[unit_type] -= 1
|
if self.units[unit_type] == 1:
|
||||||
|
del self.units[unit_type]
|
||||||
|
else:
|
||||||
|
self.units[unit_type] -= 1
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def size(self) -> int:
|
def size(self) -> int:
|
||||||
|
|||||||
Reference in New Issue
Block a user