Bugfix: Don't travel to renew house if You can't afford the house
This commit is contained in:
parent
f88eaccf67
commit
f0f47566a0
@ -1039,16 +1039,22 @@ class CitizenEconomy(CitizenTravel):
|
|||||||
|
|
||||||
global_cheapest = self.get_market_offers("House", q)[f"q{q}"]
|
global_cheapest = self.get_market_offers("House", q)[f"q{q}"]
|
||||||
if global_cheapest.price + 200 < local_cheapest.price:
|
if global_cheapest.price + 200 < local_cheapest.price:
|
||||||
|
if global_cheapest.price + 2000 < self.details.cc:
|
||||||
if self.travel_to_country(global_cheapest.country):
|
if self.travel_to_country(global_cheapest.country):
|
||||||
buy = self.buy_market_offer(global_cheapest, 1)
|
buy = self.buy_market_offer(global_cheapest, 1)
|
||||||
else:
|
else:
|
||||||
buy = {'error': True, 'message': 'Unable to travel!'}
|
buy = dict(error=True, message='Unable to travel!')
|
||||||
else:
|
else:
|
||||||
|
buy = dict(error=True, message='Not enough money to buy house!')
|
||||||
|
else:
|
||||||
|
if local_cheapest.price < self.details.cc:
|
||||||
buy = self.buy_market_offer(local_cheapest, 1)
|
buy = self.buy_market_offer(local_cheapest, 1)
|
||||||
|
else:
|
||||||
|
buy = dict(error=True, message='Not enough money to buy house!')
|
||||||
if buy is None:
|
if buy is None:
|
||||||
pass
|
pass
|
||||||
elif buy["error"]:
|
elif buy["error"]:
|
||||||
msg = f"Unable to buy q{q} house! \n{buy['message']}"
|
msg = f'Unable to buy q{q} house! \n{buy["message"]}'
|
||||||
self.write_log(msg)
|
self.write_log(msg)
|
||||||
else:
|
else:
|
||||||
ok_to_activate = True
|
ok_to_activate = True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user