initialize pl to LocalPlayer() to fix "table index is nil" error when hotloading

This commit is contained in:
vlazed 2024-08-19 14:51:38 -04:00
parent 1f521b474d
commit dfb85d538c

View File

@ -2712,7 +2712,8 @@ local RGM_NOTIFY = { -- table with info for messages, true for errors
[BONE_UNFROZEN] = false,
}
local pl
-- If we hotload this file, pl gets set to nil, which causes issues when tables attempt to index with this variable; initialize it here
local pl = LocalPlayer()
hook.Add("InitPostEntity", "rgmSetPlayer", function()
pl = LocalPlayer()