Handle inventory for changing flight size.

This commit is contained in:
Dan Albert
2020-11-09 21:29:29 -08:00
parent 840b5ce071
commit d2c831c4ee
2 changed files with 28 additions and 12 deletions

View File

@@ -49,7 +49,10 @@ class ControlPointAircraftInventory:
Args:
aircraft: The type of aircraft to query.
"""
return self.inventory[aircraft]
try:
return self.inventory[aircraft]
except KeyError:
return 0
@property
def types_available(self) -> Iterator[UnitType]: