From 3d6e0cfe70701337ac4287df5a770d85c63c5acc Mon Sep 17 00:00:00 2001 From: Webster Sheets Date: Thu, 5 Dec 2024 16:04:58 -0500 Subject: [PATCH] radar.lua: fix error when playing multiple games in the same session - Because the player variable is cached at file scope, it becomes orphaned on end game. - Reset it during cleanup phase so it can be populated with the correct Game.player object during the next game. --- data/pigui/modules/radar.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/data/pigui/modules/radar.lua b/data/pigui/modules/radar.lua index e30e140ecf..82fa17cff7 100644 --- a/data/pigui/modules/radar.lua +++ b/data/pigui/modules/radar.lua @@ -506,6 +506,7 @@ end) -- reset radar to default at game end Event.Register("onGameEnd", function() + player = nil shouldDisplay2DRadar = false radar2d:resetZoom() radar3d:resetZoom()