Fix a bug of the move_area chatcommand

This commit is contained in:
paly2 2016-06-19 16:39:25 +02:00
parent 8b0b8c1ad2
commit 93942db2c1

View File

@ -296,8 +296,7 @@ minetest.register_chatcommand("move_area", {
return false, "Invalid usage, see /help move_area." return false, "Invalid usage, see /help move_area."
end end
local area = areas.areas[id] if not areas.areas[id] then
if not area then
return false, "Area does not exist." return false, "Area does not exist."
end end
@ -306,8 +305,8 @@ minetest.register_chatcommand("move_area", {
return false, "You need to select an area first." return false, "You need to select an area first."
end end
area.pos1 = pos1 areas.areas[id].pos1 = pos1
area.pos2 = pos2 areas.areas[id].pos2 = pos2
areas:save() areas:save()
return true, "Area successfully moved." return true, "Area successfully moved."
end, end,