From 201591d46966949dc225f7f58b3579bab6747c19 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Sun, 21 Dec 2025 18:27:26 -0800 Subject: [PATCH] fix dopewar replay bug reference https://github.com/SpudGunMan/meshing-around/issues/274 thanks MJTheis Co-Authored-By: MJTheis <232630404+mjtheis@users.noreply.github.com> --- mesh_bot.py | 5 ----- modules/games/dopewar.py | 7 +++++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/mesh_bot.py b/mesh_bot.py index af83915..8a72d4f 100755 --- a/mesh_bot.py +++ b/mesh_bot.py @@ -738,11 +738,6 @@ def handleDopeWars(message, nodeID, rxNode): if p.get('userID') == nodeID: p['last_played'] = time.time() msg = playDopeWars(nodeID, message) - - # if message starts wth 'e'xit remove player from tracker - if message.lower().startswith('e'): - dwPlayerTracker[:] = [p for p in dwPlayerTracker if p.get('userID') != nodeID] - msg = 'You have exited Dope Wars.' return msg def handle_gTnW(chess = False): diff --git a/modules/games/dopewar.py b/modules/games/dopewar.py index b7e9e83..1cdd044 100644 --- a/modules/games/dopewar.py +++ b/modules/games/dopewar.py @@ -391,6 +391,13 @@ def endGameDw(nodeID): return msg if cash < starting_cash: msg = "You lost money, better go get a real job.💸" + + # remove player from all trackers and databases + dwPlayerTracker[:] = [p for p in dwPlayerTracker if p.get('userID') != nodeID] + dwCashDb[:] = [p for p in dwCashDb if p.get('userID') != nodeID] + dwInventoryDb[:] = [p for p in dwInventoryDb if p.get('userID') != nodeID] + dwLocationDb[:] = [p for p in dwLocationDb if p.get('userID') != nodeID] + dwGameDayDb[:] = [p for p in dwGameDayDb if p.get('userID') != nodeID] return msg