Fix rename_area and buildable_to nodes on the edges of areas

This commit is contained in:
ShadowNinja
2013-09-03 17:09:11 -04:00
parent 7b0ff512f7
commit b1a4f878ef
3 changed files with 28 additions and 24 deletions

View File

@ -144,14 +144,14 @@ minetest.register_chatcommand("rename_area", {
privs = {},
func = function(name, param)
local found, _, id, newName = param:find("^(%d+)%s(.+)$")
if not found then
minetest.chat_send_player(name,
"Invalid usage, see /help rename_area")
return
end
index = areas:getIndexById(tonumber(id))
id = tonumber(id)
index = areas:getIndexById(id)
if not index then
minetest.chat_send_player(name, "That area doesn't exist.")
@ -165,6 +165,7 @@ minetest.register_chatcommand("rename_area", {
areas.areas[index].name = newName
areas:save()
minetest.chat_send_player(name, "Area renamed.")
end})