compat(lua50): replace % modulo operator with math.mod shim
Lua 5.0 (Vanilla 1.12) has no % operator outside string formatting; it is a parse error. Route the 9 arithmetic modulo sites through the existing math.mod shim (Compat/Compat.lua) so the addon parses on 5.0 through Retail. Sites: QuestieDB daily/weekly flag tests, QuestieEvent DMF cycle math, QuestieLearner GUID/flag math, QuestiePlayer race/class flag tests.
This commit is contained in:
@@ -915,7 +915,7 @@ end
|
||||
function QuestieDB.IsDailyQuest(questId)
|
||||
local flags = QuestieDB.QueryQuestSingle(questId, "questFlags")
|
||||
-- test a bit flag: (value % (2*flag) >= flag)
|
||||
return flags and (flags % QUEST_FLAGS_DAILY_X2) >= QUEST_FLAGS_DAILY
|
||||
return flags and math.mod(flags, QUEST_FLAGS_DAILY_X2) >= QUEST_FLAGS_DAILY
|
||||
end
|
||||
|
||||
---@param questId number
|
||||
@@ -923,7 +923,7 @@ end
|
||||
function QuestieDB.IsWeeklyQuest(questId)
|
||||
local flags = QuestieDB.QueryQuestSingle(questId, "questFlags")
|
||||
-- test a bit flag: (value % (2*flag) >= flag)
|
||||
return flags and (flags % QUEST_FLAGS_WEEKLY_X2) >= QUEST_FLAGS_WEEKLY
|
||||
return flags and math.mod(flags, QUEST_FLAGS_WEEKLY_X2) >= QUEST_FLAGS_WEEKLY
|
||||
end
|
||||
|
||||
---@param questId number
|
||||
|
||||
Reference in New Issue
Block a user