Update house counts from rent lines
When 'with N houses, rent is X' or 'with a hotel, rent is X' is seen, update property_houses for the current player's location. This partially fixes stale house data in the UI — houses are synced when rent is charged, though not at the moment of purchase.
This commit is contained in:
parent
1cb6da257f
commit
a08fd86bf2
2 changed files with 14 additions and 0 deletions
|
|
@ -679,13 +679,20 @@ class MonopParser:
|
|||
|
||||
m = self.RENT_HOUSES_RE.match(msg)
|
||||
if m:
|
||||
houses = int(m.group(1))
|
||||
rent = int(m.group(2))
|
||||
# Update house count for this property (player just landed here)
|
||||
if cp and 0 <= cp.location < 40:
|
||||
g.property_houses[cp.location] = houses
|
||||
self._pay_rent(rent)
|
||||
return
|
||||
|
||||
m = self.RENT_HOTEL_RE.match(msg)
|
||||
if m:
|
||||
rent = int(m.group(1))
|
||||
# Hotel = 5 houses
|
||||
if cp and 0 <= cp.location < 40:
|
||||
g.property_houses[cp.location] = 5
|
||||
self._pay_rent(rent)
|
||||
return
|
||||
|
||||
|
|
|
|||
|
|
@ -679,13 +679,20 @@ class MonopParser:
|
|||
|
||||
m = self.RENT_HOUSES_RE.match(msg)
|
||||
if m:
|
||||
houses = int(m.group(1))
|
||||
rent = int(m.group(2))
|
||||
# Update house count for this property (player just landed here)
|
||||
if cp and 0 <= cp.location < 40:
|
||||
g.property_houses[cp.location] = houses
|
||||
self._pay_rent(rent)
|
||||
return
|
||||
|
||||
m = self.RENT_HOTEL_RE.match(msg)
|
||||
if m:
|
||||
rent = int(m.group(1))
|
||||
# Hotel = 5 houses
|
||||
if cp and 0 <= cp.location < 40:
|
||||
g.property_houses[cp.location] = 5
|
||||
self._pay_rent(rent)
|
||||
return
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue