cleanup
This commit is contained in:
parent
3ad7172925
commit
19113da8e6
@ -1152,11 +1152,13 @@ class CitizenEconomy(CitizenTravel):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def post_market_offer(self, industry: int, quality: int, amount: int, price: float) -> bool:
|
def post_market_offer(self, industry: int, quality: int, amount: int, price: float) -> bool:
|
||||||
|
if isinstance(industry, str):
|
||||||
|
industry = constants.INDUSTRIES[industry]
|
||||||
if not constants.INDUSTRIES[industry]:
|
if not constants.INDUSTRIES[industry]:
|
||||||
self.write_log(f"Trying to sell unsupported industry {industry}")
|
self.write_log(f"Trying to sell unsupported industry {industry}")
|
||||||
|
|
||||||
_inv_qlt = quality if industry in [1, 2, 3, 4, 23] else 0
|
_inv_qlt = quality if industry in [1, 2, 3, 4, 23] else 0
|
||||||
_kind = 'final' if industry in [1, 2, 4, 4, 23] else 'raw'
|
_kind = 'final' if industry in [1, 2, 4, 23] else 'raw'
|
||||||
inventory = self.get_inventory()
|
inventory = self.get_inventory()
|
||||||
items = inventory[_kind].get(constants.INDUSTRIES[industry], {_inv_qlt: {'amount': 0}})
|
items = inventory[_kind].get(constants.INDUSTRIES[industry], {_inv_qlt: {'amount': 0}})
|
||||||
if items[_inv_qlt]['amount'] < amount:
|
if items[_inv_qlt]['amount'] < amount:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user