fix: use rawget for global bit library lookups and fix variable assignment in trainer fan club

This commit is contained in:
1jamie
2026-09-21 17:21:20 -05:00
parent eee6637842
commit dffcaeb4c0
3 changed files with 5 additions and 3 deletions
+3 -1
View File
@@ -302,7 +302,9 @@ function TrainerFanClub.tryGainNewFanFromCounter(session, ctx, counterIdx)
if timer + inc >= 20 then
if TrainerFanClub.countFans(fanFlags) < 3 then
TrainerFanClub.playerGainRandomTrainerFan(session, ctx)
_, gotInitialFans, fanFlags = TrainerFanClub.getFanClubData(session, ctx)
local _unused, newGotInitial, newFanFlags = TrainerFanClub.getFanClubData(session, ctx)
gotInitialFans = newGotInitial
fanFlags = newFanFlags
timer = 0
else
timer = 20
+1 -1
View File
@@ -12,7 +12,7 @@ do
end
end
local bit = bit or bit32
local bit = rawget(_G, "bit") or rawget(_G, "bit32")
if not bit then
local ok, mod = pcall(require, "bit")
if ok and mod then bit = mod end
+1 -1
View File
@@ -97,7 +97,7 @@ do
end
end
local bit = bit or bit32
local bit = rawget(_G, "bit") or rawget(_G, "bit32")
if not bit then
local ok, mod = pcall(require, "bit")
if ok and mod then bit = mod end