Updated classes.OfferItem default price to be higher considerably higher than max price for cheapest most expensive items on sale (Q5 houses), Updated house renewal
This commit is contained in:
parent
c1e8e94cba
commit
fa3881bf10
@ -1026,7 +1026,6 @@ class CitizenEconomy(CitizenTravel):
|
|||||||
ret.update({house_quality: till})
|
ret.update({house_quality: till})
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
@utils.wait_for_lock
|
|
||||||
def buy_and_activate_house(self, q: int) -> Optional[Dict[int, datetime]]:
|
def buy_and_activate_house(self, q: int) -> Optional[Dict[int, datetime]]:
|
||||||
original_region = self.details.current_country, self.details.current_region
|
original_region = self.details.current_country, self.details.current_region
|
||||||
ok_to_activate = False
|
ok_to_activate = False
|
||||||
@ -1041,12 +1040,14 @@ 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 self.travel_to_country(global_cheapest.country):
|
if self.travel_to_country(global_cheapest.country):
|
||||||
buy = self.buy_from_market(global_cheapest.offer_id, 1)
|
buy = self.buy_market_offer(global_cheapest, 1)
|
||||||
else:
|
else:
|
||||||
buy = {'error': True, 'message': 'Unable to travel!'}
|
buy = {'error': True, 'message': 'Unable to travel!'}
|
||||||
else:
|
else:
|
||||||
buy = self.buy_from_market(local_cheapest.offer_id, 1)
|
buy = self.buy_market_offer(local_cheapest, 1)
|
||||||
if buy["error"]:
|
if buy is None:
|
||||||
|
pass
|
||||||
|
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:
|
||||||
|
@ -1016,7 +1016,7 @@ class TelegramBot:
|
|||||||
|
|
||||||
|
|
||||||
class OfferItem(NamedTuple):
|
class OfferItem(NamedTuple):
|
||||||
price: float = 99_999.
|
price: float = 999_999_999.
|
||||||
country: constants.Country = constants.Country(0, "", "", "")
|
country: constants.Country = constants.Country(0, "", "", "")
|
||||||
amount: int = 0
|
amount: int = 0
|
||||||
offer_id: int = 0
|
offer_id: int = 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user