Browse Source

fix lua table insanity

main
Hendrik Langer 5 years ago
parent
commit
c3b1a506ba
  1. 10
      items.lua

10
items.lua

@ -18,8 +18,14 @@ if minetest.get_modpath("areas") then
-- allow for players with areas privilege -- allow for players with areas privilege
if not player_owns_id and minetest.check_player_privs(name, { areas=true }) then if not player_owns_id and minetest.check_player_privs(name, { areas=true }) then
if table.getn(current_areas) == 1 then local num_current_areas = 0
player_owns_id = current_areas[1] or current_areas[0] local current_area_id = nil
for areas_id, areas_area in pairs( current_areas ) do
num_current_areas = num_current_areas + 1
current_area_id = "a"..tostring(areas_id)
end
if num_current_areas == 1 then
player_owns_id = current_area_id
else else
minetest.chat_send_player(name, "[creative_regions] Area ambiguous: You are in multiple areas.") minetest.chat_send_player(name, "[creative_regions] Area ambiguous: You are in multiple areas.")
minetest.after(0.2, function(pos) minetest.after(0.2, function(pos)

Loading…
Cancel
Save