From f7037ce504d2db78759cb03d174e4bd0e9f0e179 Mon Sep 17 00:00:00 2001 From: Emik Date: Thu, 27 Mar 2025 20:24:43 +0100 Subject: [PATCH] Fix sinister erroneously activating --- lovely.toml | 6 ++++-- src/main.lua | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lovely.toml b/lovely.toml index 7986c8a..78d439c 100644 --- a/lovely.toml +++ b/lovely.toml @@ -42,10 +42,12 @@ match_indent = true target = "functions/misc_functions.lua" pattern = "local AC = G.SETTINGS.ambient_control" position = "before" -payload = '''if Jane and G.ARGS.score_intensity.required_score ~= 0 then +payload = '''if Jane and (type(G.ARGS.score_intensity.required_score) == "table" and G.ARGS.score_intensity.required_score:to_number() or G.ARGS.score_intensity.required_score) ~= 0 then + local break_infinity = ((Talisman or {}).config_file or {}).break_infinity + local big = (break_infinity == "" or break_infinity == nil) and function (x) return x end or to_big local base = Cryptid and 10 or G.ARGS.score_intensity.required_score local expo = Cryptid and G.ARGS.score_intensity.required_score or 10 - Jane.sinister = (G.ARGS.score_intensity.earned_score / (to_big(base) ^ to_big(expo))):to_number() > 1 + Jane.sinister = (G.ARGS.score_intensity.earned_score / (big(base) ^ big(expo))):to_number() > 1 end''' match_indent = true diff --git a/src/main.lua b/src/main.lua index c2d279d..a6b7e46 100644 --- a/src/main.lua +++ b/src/main.lua @@ -127,8 +127,9 @@ function Jane.get_chipmult_sum(chips, mult) chips = chips or 0 mult = mult or 0 - local op, big = Jane.get_operator(), Talisman.config_file.break_infinity == "omeganum" and - to_big or function (x) return x end + local break_infinity = ((Talisman or {}).config_file or {}).break_infinity + local big = (break_infinity == "" or break_infinity == nil) and function (x) return x end or to_big + local op = Jane.get_operator() if op >= 3 then return big(chips) ^ big(mult)