Clear node probability for default prob

This commit is contained in:
Wuzzy 2017-09-01 23:14:46 +02:00
parent 918e68dfe6
commit f78d538fdb
1 changed files with 5 additions and 1 deletions

View File

@ -330,8 +330,12 @@ advschem.add_form("prob", {
-- Update probability
if fields.probability ~= "" then
local prob = tonumber(fields.probability)
if prob and prob >= 0 and prob <= 127 then
if prob and prob >= 0 and prob < 127 then
smeta:set_string("advschem_prob", fields.probability)
elseif prob and prob == 127 then
-- Clear prob metadata for default probability
prob_desc = ""
smeta:set_string("advschem_prob", nil)
else
prob_desc = "\nProbability: "..(smeta:get_string("advschem_prob") or
"Not Set")