mirror of git://repo.or.cz/minetest_schemedit.git
Clear node probability for default prob
This commit is contained in:
parent
918e68dfe6
commit
f78d538fdb
6
init.lua
6
init.lua
|
@ -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")
|
||||
|
|
Loading…
Reference in New Issue