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:
Xurkon
2026-06-12 18:35:31 -05:00
parent 76d4e6e4c8
commit 9dce126735
4 changed files with 9 additions and 9 deletions
+2 -2
View File
@@ -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