From 82bb5e940db6b656d59652517b16a34fb46e9ee6 Mon Sep 17 00:00:00 2001 From: kohashiwakaba Date: Tue, 1 Feb 2022 10:34:32 +0900 Subject: [PATCH] Fix modifier issues --- eid_api.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/eid_api.lua b/eid_api.lua index ce6108d6..1628cde3 100644 --- a/eid_api.lua +++ b/eid_api.lua @@ -849,6 +849,13 @@ end -- Adds Description object modifiers. -- Used for altering descriptions. Example: Spindown dice, Tarot Cloth, ... function EID:addDescriptionModifier(modifierName, condition, callback) + for i,v in ipairs(EID.DescModifiers) do + if v["name"] == modifierName then + v["condition"] = condition + v["callback"] = callback + return + end + end table.insert(EID.DescModifiers, { name = modifierName, condition = condition, @@ -860,7 +867,7 @@ end -- Used for altering descriptions. Example: Spindown dice, Tarot Cloth, ... function EID:removeDescriptionModifier(modifierName) for i,v in ipairs(EID.DescModifiers) do - if v[name] == modifierName then + if v["name"] == modifierName then table.remove(EID.DescModifiers,i) return end