diff --git a/worldeditadditions/utils/parse/chance.lua b/worldeditadditions/utils/parse/chance.lua index 9b5e13e..8126983 100644 --- a/worldeditadditions/utils/parse/chance.lua +++ b/worldeditadditions/utils/parse/chance.lua @@ -6,7 +6,7 @@ function worldeditadditions.parse.chance(str) if tonumber(str) ~= nil then return tonumber(str) end if str:sub(#str) == "%" then local result = tonumber(str:sub(1, #str-1)) - if result == nil then return nil end + if not result then return nil end return 1 / (result / 100) -- Convert percentage to 1-in-N chance end return nil