CitizenEconomy.post_market_offer() bugfix
This commit is contained in:
parent
7bb988f716
commit
c81986d65e
@ -1120,14 +1120,16 @@ class CitizenEconomy(CitizenTravel):
|
|||||||
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}")
|
||||||
|
|
||||||
final = industry in [1, 2, 4, 23]
|
_inv_qlt = quality if industry in [1, 2, 3, 4, 23] else 0
|
||||||
items = self.inventory['final' if final else 'raw'][constants.INDUSTRIES[industry]]
|
_kind = 'final' if industry in [1, 2, 4, 4, 23] else 'raw'
|
||||||
if items[quality if final else 0]['amount'] < amount:
|
inventory = self.get_inventory()
|
||||||
self.update_inventory()
|
items = inventory[_kind].get(constants.INDUSTRIES[industry], {_inv_qlt: {'amount': 0}})
|
||||||
items = self.inventory['final' if final else 'raw'][constants.INDUSTRIES[industry]]
|
if items[_inv_qlt]['amount'] < amount:
|
||||||
if items[quality if final else 0]['amount'] < amount:
|
inventory = self.get_inventory(True)
|
||||||
|
items = inventory[_kind].get(constants.INDUSTRIES[industry], {_inv_qlt: {'amount': 0}})
|
||||||
|
if items[_inv_qlt]['amount'] < amount:
|
||||||
self._report_action("ECONOMY_SELL_PRODUCTS", "Unable to sell! Not enough items in storage!",
|
self._report_action("ECONOMY_SELL_PRODUCTS", "Unable to sell! Not enough items in storage!",
|
||||||
kwargs=dict(inventory=items[quality if final else 0], amount=amount))
|
kwargs=dict(inventory=items[_inv_qlt], amount=amount))
|
||||||
return False
|
return False
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user