From a7c26b74bbdafc93f8a2441f692647a7e55a47ed Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Thu, 20 Apr 2023 23:14:53 -0400 Subject: Returning to main menu now disconnects --- Archipelago/client.gd | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'Archipelago/client.gd') diff --git a/Archipelago/client.gd b/Archipelago/client.gd index bb6d0a2..f805577 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd @@ -98,10 +98,15 @@ func _ready(): _client.connect("data_received", self, "_on_data") -func _errored(): - global._print("AP connection failed") +func _reset_state(): _should_process = false _authenticated = false + _map_loaded = false + + +func _errored(): + global._print("AP connection failed") + _reset_state() emit_signal( "could_not_connect", @@ -109,10 +114,9 @@ func _errored(): ) -func _closed(): +func _closed(_was_clean = true): global._print("Connection closed") - _should_process = false - _authenticated = false + _reset_state() if not _initiated_disconnect: emit_signal("could_not_connect", "Disconnected from Archipelago") -- cgit 1.4.1