From da856d746e2af55bce8eeb3455c89678a9273ff3 Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Fri, 8 Nov 2024 10:49:59 -0300 Subject: [PATCH] improve: lower boss name on boss lever system (#3070) This ensures the integrity of the name during searches. If a name is added with a different capitalization than the monster's actual name, it can lead to conflicts, preventing the onDeath code from executing properly. --- data/libs/functions/boss_lever.lua | 2 +- data/scripts/creaturescripts/monster/boss_lever_death.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/libs/functions/boss_lever.lua b/data/libs/functions/boss_lever.lua index da3b81d3704..3d430394f2a 100644 --- a/data/libs/functions/boss_lever.lua +++ b/data/libs/functions/boss_lever.lua @@ -56,7 +56,7 @@ setmetatable(BossLever, { error("BossLever: boss is required") end return setmetatable({ - name = boss.name, + name = boss.name:lower(), encounter = config.encounter, bossPosition = boss.position, timeToFightAgain = config.timeToFightAgain or configManager.getNumber(configKeys.BOSS_DEFAULT_TIME_TO_FIGHT_AGAIN), diff --git a/data/scripts/creaturescripts/monster/boss_lever_death.lua b/data/scripts/creaturescripts/monster/boss_lever_death.lua index 4e035271623..35a86a97e92 100644 --- a/data/scripts/creaturescripts/monster/boss_lever_death.lua +++ b/data/scripts/creaturescripts/monster/boss_lever_death.lua @@ -13,7 +13,7 @@ function onBossDeath.onDeath(creature) return true end - local bossLever = BossLever[name] + local bossLever = BossLever[name:lower()] if not bossLever then return true end