Skip to content

Commit

Permalink
improve: lower boss name on boss lever system (#3070)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dudantas authored Nov 8, 2024
1 parent 59a24c3 commit da856d7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion data/libs/functions/boss_lever.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion data/scripts/creaturescripts/monster/boss_lever_death.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit da856d7

Please sign in to comment.