From cb0412e011d52e8746fd6a1b2fdc95f8fd33e581 Mon Sep 17 00:00:00 2001
From: FlySniper <brajcan@hotmail.com>
Date: Thu, 16 Nov 2023 05:35:20 -0500
Subject: [PATCH] Wargroove: Fixed WargrooveClient retaining victory and
 location information and minor doc fix (#2464)

---
 WargrooveClient.py                    | 8 ++++++++
 worlds/wargroove/docs/wargroove_en.md | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/WargrooveClient.py b/WargrooveClient.py
index 16bfeb15..77180502 100644
--- a/WargrooveClient.py
+++ b/WargrooveClient.py
@@ -113,6 +113,9 @@ class WargrooveContext(CommonContext):
     async def connection_closed(self):
         await super(WargrooveContext, self).connection_closed()
         self.remove_communication_files()
+        self.checked_locations.clear()
+        self.server_locations.clear()
+        self.finished_game = False
 
     @property
     def endpoints(self):
@@ -124,6 +127,9 @@ class WargrooveContext(CommonContext):
     async def shutdown(self):
         await super(WargrooveContext, self).shutdown()
         self.remove_communication_files()
+        self.checked_locations.clear()
+        self.server_locations.clear()
+        self.finished_game = False
 
     def remove_communication_files(self):
         for root, dirs, files in os.walk(self.game_communication_path):
@@ -402,8 +408,10 @@ async def game_watcher(ctx: WargrooveContext):
                 if file.find("send") > -1:
                     st = file.split("send", -1)[1]
                     sending = sending+[(int(st))]
+                    os.remove(os.path.join(ctx.game_communication_path, file))
                 if file.find("victory") > -1:
                     victory = True
+                    os.remove(os.path.join(ctx.game_communication_path, file))
         ctx.locations_checked = sending
         message = [{"cmd": 'LocationChecks', "locations": sending}]
         await ctx.send_msgs(message)
diff --git a/worlds/wargroove/docs/wargroove_en.md b/worlds/wargroove/docs/wargroove_en.md
index 121e8c08..1954dc01 100644
--- a/worlds/wargroove/docs/wargroove_en.md
+++ b/worlds/wargroove/docs/wargroove_en.md
@@ -18,7 +18,7 @@ is strongly recommended in case they become corrupted.
 2. Open the `host.yaml` file in your favorite text editor (Notepad will work).
 3. Put your Wargroove root directory in the `root_directory:` under the `wargroove_options:` section.
    - The Wargroove root directory can be found by going to 
-   `Steam->Right Click Wargroove->Properties->Local Files->Browse Local Files` and copying the path in the address bar.
+   `Steam->Right Click Wargroove->Properties->Installed Files->Browse` and copying the path in the address bar.
    - Paste the path in between the quotes next to `root_directory:` in the `host.yaml`.
    - You may have to replace all single \\ with \\\\.
 4. Start the Wargroove client.