mirror of
https://github.com/bryanthaboi/gen1recomp
synced 2026-09-30 07:22:37 -04:00
fix: use rawget for global bit library lookups and fix variable assignment in trainer fan club
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user