Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle nil value for soul war to prevent errors with custom data #2964

Merged
merged 4 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion data/libs/functions/monstertype.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function MonsterType:generateLootRoll(config, resultTable, player)
end

local chance = item.chance
if iType:getId() == SoulWarQuest.bagYouDesireItemId then
if SoulWarQuest and iType:getId() == SoulWarQuest.bagYouDesireItemId then
result[item.itemId].chance = self:calculateBagYouDesireChance(player, chance)
logger.debug("Final chance for bag you desire: {}, original chance: {}", result[item.itemId].chance, chance)
end
Expand Down
4 changes: 3 additions & 1 deletion data/scripts/lib/quests.lua
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
-- We need to register the variables beforehand to avoid accessing null values.
RegisterSoulWarBossesLevers()
if RegisterSoulWarBossesLevers then
RegisterSoulWarBossesLevers()
end
Loading