mirror of
git://repo.or.cz/minetest_schemedit.git
synced 2024-11-13 19:20:16 +01:00
Prevent adding dupe slice definitions
This commit is contained in:
parent
cd808777c8
commit
f0c5c2659f
13
init.lua
13
init.lua
|
@ -635,7 +635,18 @@ schemedit.add_form("slice", {
|
|||
index = self.selected
|
||||
end
|
||||
|
||||
slice_list[index] = {ypos = ypos, prob = prob}
|
||||
local dupe = false
|
||||
if fields.done_add then
|
||||
for k,v in pairs(slice_list) do
|
||||
if v.ypos == ypos then
|
||||
v.prob = prob
|
||||
dupe = true
|
||||
end
|
||||
end
|
||||
end
|
||||
if not dupe then
|
||||
slice_list[index] = {ypos = ypos, prob = prob}
|
||||
end
|
||||
|
||||
meta:set_string("slices", minetest.serialize(slice_list))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user