diff --git a/handlers.lua b/handlers.lua index 762fbf1..f4416a0 100644 --- a/handlers.lua +++ b/handlers.lua @@ -104,6 +104,11 @@ function handlers.handleDisconnectButton(eventType, side, x, y) return nil end + -- Only process if stargate is actually connected + if not gate.isStargateConnected() then + return nil + end + -- Check if clicking disconnect button (bottom-right corner) if y >= 17 and y <= 19 and x >= 20 and x <= 28 then gate.disconnectStargate() diff --git a/startup.lua b/startup.lua index 6c5a825..7cd5a55 100644 --- a/startup.lua +++ b/startup.lua @@ -516,7 +516,7 @@ local function selectGateFromList() break end end - + -- Check back button (x: 23-28, y: 17-19) if not dialing and sely >= 17 and sely <= 19 and selx >= 23 and selx <= 28 then selecting = false