Browse Source

rename region fix

main
Hendrik Langer 5 years ago
parent
commit
f767c8c201
  1. 7
      chatcommands.lua

7
chatcommands.lua

@ -93,12 +93,15 @@ minetest.register_chatcommand("creative_region_rn", {
end
local astore_id = tonumber(string.sub(region_id, 2))
local astore_area = creative_regions.astore:get_area(astore_id, true, true)
if astore_area and astore_area.id == astore_id then
if astore_area then
local success = creative_regions.astore:remove_area(astore_id)
local edge1 = astore_area.min
local edge2 = astore_area.max
local data = tostring(region_name)
local new_id = creative_regions.astore:insert_area(edge1, edge2, data, astore_id)
local new_id = nil
if success then
new_id = creative_regions.astore:insert_area(edge1, edge2, data, astore_id)
end
if new_id == astore_id then
minetest.chat_send_player(name, "[creative_regions] Region " .. region_id .. " updated")

Loading…
Cancel
Save