Skip to content

Commit 5b6ee99

Browse files
authored
duplicare probability context fix part 1
i'm too lazy to fork cryptid locally
1 parent 19cc783 commit 5b6ee99

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lib/misc.lua

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,3 +1457,18 @@ function Cryptid.get_next_tag(override)
14571457
return "tag_cry_cat"
14581458
end
14591459
end
1460+
1461+
-- for Cryptid.isNonRollProbabilityContext
1462+
local probability_contexts = {
1463+
"mod_probability",
1464+
"fix_probability"
1465+
}
1466+
1467+
-- Checks if a context table is a probability context called outside of a roll
1468+
function Cryptid.isNonRollProbabilityContext(context)
1469+
for _, ctx in ipairs(probability_contexts) do
1470+
if context[ctx] then return context.from_roll end
1471+
end
1472+
1473+
return true
1474+
end

0 commit comments

Comments
 (0)