From 040d7fbfde0668fcafdbabcd590bd74daca869f7 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Tue, 11 May 2021 21:59:43 +0100 Subject: [PATCH] wea.parse.chance: use not --- worldeditadditions/utils/parse/chance.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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