@@ -18,14 +18,14 @@ local function init_new_player(index, player)
1818 -- initialize player(s) when mod is loaded into existing game
1919 player .print (" init_new_player" )
2020 TLBE .Config .reload ({ player_index = index })
21- TLBE .GUI .initialize (player , global .playerSettings [index ])
21+ TLBE .GUI .initialize (player , storage .playerSettings [index ])
2222
2323 player .print ({ " mod-loaded" }, { r = 1 , g = 0.5 , b = 0 })
2424 player .print ({ " mod-loaded2" })
2525end
2626
2727local function on_init ()
28- global .playerSettings = {}
28+ storage .playerSettings = {}
2929
3030 for index , player in pairs (game .players ) do
3131 -- initialize player(s) when mod is loaded into existing game
@@ -37,7 +37,7 @@ local function on_init()
3737 if baseBBox ~= nil then
3838 -- Update base trackers of each player
3939 for index , _ in pairs (game .players ) do
40- local baseTracker = global .playerSettings [index ].trackers [3 ]
40+ local baseTracker = storage .playerSettings [index ].trackers [3 ]
4141 baseTracker .minPos = baseBBox .minPos
4242 baseTracker .maxPos = baseBBox .maxPos
4343 TLBE .Tracker .updateCenterAndSize (baseTracker )
@@ -57,7 +57,7 @@ local function on_configuration_changed(event)
5757 -- Sometimes playerSettings does not seem to be present when upgrading
5858 -- from older versions. We can just fix this issue here.
5959 for index , player in pairs (game .players ) do
60- if global .playerSettings [index ] == nil then
60+ if storage .playerSettings [index ] == nil then
6161 player .print ({ " migration-fix-missing-player-data" })
6262 init_new_player (index , player )
6363 end
@@ -73,7 +73,7 @@ local function on_player_created(event)
7373 local player = game .players [event .player_index ]
7474 player .print ({ " mod-loaded2" }, { r = 1 , g = 0.5 , b = 0 })
7575
76- TLBE .GUI .initialize (player , global .playerSettings [event .player_index ])
76+ TLBE .GUI .initialize (player , storage .playerSettings [event .player_index ])
7777end
7878
7979
0 commit comments