mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Decouple unit deliveries and conflict events.
Fixes https://github.com/Khopa/dcs_liberation/issues/692 and lets us clean up the interface quite a bit.
This commit is contained in:
@@ -36,7 +36,6 @@ class QRecruitBehaviour:
|
||||
|
||||
@property
|
||||
def pending_deliveries(self) -> UnitsDeliveryEvent:
|
||||
assert self.cp.pending_unit_deliveries
|
||||
return self.cp.pending_unit_deliveries
|
||||
|
||||
@property
|
||||
@@ -128,7 +127,7 @@ class QRecruitBehaviour:
|
||||
def buy(self, unit_type: Type[UnitType]):
|
||||
price = db.PRICES[unit_type]
|
||||
if self.budget >= price:
|
||||
self.pending_deliveries.deliver({unit_type: 1})
|
||||
self.pending_deliveries.order({unit_type: 1})
|
||||
self.budget -= price
|
||||
else:
|
||||
# TODO : display modal warning
|
||||
|
||||
Reference in New Issue
Block a user