Skip to content

Commit

Permalink
radar.lua: fix error when playing multiple games in the same session
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
sturnclaw committed Dec 7, 2024
1 parent e02a104 commit 3d6e0cf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions data/pigui/modules/radar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,7 @@ end)

-- reset radar to default at game end
Event.Register("onGameEnd", function()
player = nil
shouldDisplay2DRadar = false
radar2d:resetZoom()
radar3d:resetZoom()
Expand Down

0 comments on commit 3d6e0cf

Please sign in to comment.