Browse Source

fix area_ids

main
Hendrik Langer 5 years ago
parent
commit
37d9e4ab75
  1. 6
      init.lua

6
init.lua

@ -70,7 +70,7 @@ minetest.register_chatcommand("creative_area_privs", {
if not player then
return false, "Player not found"
end
local found, _, area_id, privstring = param:find("^([+-]?%d+)%s*,%s*(.+)$")
local found, _, area_id, privstring = param:find("^([+-]?%a?%d+)%s*,%s*(.+)$")
if not found then
return false, "Syntax error"
end
@ -129,8 +129,8 @@ function switch_creative:decode_privs_string(str)
end
function switch_creative:is_areas_mod(area_id)
local is_areas_id = string.sub(id, 1, 2) == "a_"
local a_id = tonumber( string.sub(id, 3) )
local is_areas_id = string.sub(id, 1, 2) == "a"
local a_id = tonumber( string.sub(id, 2) )
return is_areas_id, a_id
end

Loading…
Cancel
Save