From a08fd86bf2579b8634ec3c886bdf3d22dda65723 Mon Sep 17 00:00:00 2001 From: Jarvis Date: Sat, 21 Feb 2026 19:01:08 +0000 Subject: [PATCH] Update house counts from rent lines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- monop_parser.py | 7 +++++++ plugins/monop/monop_parser.py | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/monop_parser.py b/monop_parser.py index 18370d3..17f535a 100644 --- a/monop_parser.py +++ b/monop_parser.py @@ -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 diff --git a/plugins/monop/monop_parser.py b/plugins/monop/monop_parser.py index 18370d3..17f535a 100644 --- a/plugins/monop/monop_parser.py +++ b/plugins/monop/monop_parser.py @@ -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