1
0
mirror of git://repo.or.cz/minetest_schemedit.git synced 2025-01-24 00:40:20 +01:00

Clear node probability for default prob

This commit is contained in:
Wuzzy 2017-09-01 23:14:46 +02:00
parent 918e68dfe6
commit f78d538fdb

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")