|
|
@ -22,7 +22,7 @@ dofile(creative_regions.modpath.."/arena.lua") |
|
|
|
dofile(creative_regions.modpath.."/vehicles.lua") |
|
|
|
|
|
|
|
|
|
|
|
function creative_regions:update_player(player) |
|
|
|
function creative_regions:update_player(player, initialize) |
|
|
|
local name = player:get_player_name() |
|
|
|
local pos = vector.round(player:get_pos()) |
|
|
|
|
|
|
@ -35,6 +35,7 @@ function creative_regions:update_player(player) |
|
|
|
local areas_guest = false |
|
|
|
local areas_open = false |
|
|
|
local areas_individual_override = false |
|
|
|
initialize = initialize or 0 |
|
|
|
|
|
|
|
-- skip for players with protection_bypass |
|
|
|
if minetest.check_player_privs(name, { protection_bypass=true }) then |
|
|
@ -98,8 +99,8 @@ function creative_regions:update_player(player) |
|
|
|
-- did the regions change? update |
|
|
|
-- ToDo: Update on privileges changed |
|
|
|
local player_last_active_region_str = pmeta:get_string("creative_regions.active_regions") or "" |
|
|
|
if player_active_region_str ~= player_last_active_region_str then |
|
|
|
creative_regions:player_enter_region(player, new_privs_table) |
|
|
|
if player_active_region_str ~= player_last_active_region_str or initialize then |
|
|
|
creative_regions:player_enter_region(player, new_privs_table, initialize) |
|
|
|
pmeta:set_string("creative_regions.active_regions", player_active_region_str) |
|
|
|
end |
|
|
|
|
|
|
@ -109,6 +110,10 @@ end |
|
|
|
|
|
|
|
creative_regions.load_regions() |
|
|
|
|
|
|
|
minetest.register_on_joinplayer(function(player) |
|
|
|
creative_regions:update_player(player, 1) |
|
|
|
end) |
|
|
|
|
|
|
|
local timer = 0 |
|
|
|
minetest.register_globalstep(function(dtime) |
|
|
|
timer = timer + dtime |
|
|
|