diff --git a/join.lua b/join.lua index b41ef90..515d8e4 100644 --- a/join.lua +++ b/join.lua @@ -46,9 +46,9 @@ end -- Code formspec on join for fediauth enabled players minetest.register_on_joinplayer(function(player) local playername = player:get_player_name() - playerpos_stor[playername] = player:getpos() + playerpos_stor[playername] = player:get_pos() armor_stor[playername] = player:get_armor_groups() - if minetest.settings.get_bool("fediauth.make_immortal_player", true) then + if minetest.settings:get_bool("fediauth.make_immortal_player", true) then player:set_armor_groups({immortal = 1}) end @@ -210,6 +210,12 @@ if minetest.settings:get_bool("fediauth.position_lock", true) then if fediauth_sessions[playername] ~= nil then if playerpos ~= playerpos_stor[playername] then -- position lock, stupid, but works as possible -- maybe compatible with others mods who override physics + -- player can't move too far (around 1-2 blocks, default walk speed) + -- Why not just kick when move? Because: + -- - if you joined and fall from sky without fly privege + -- - if your position on slope and etc... + -- Why not just use physics override? Because + -- - It not work with mod like flyspeed player:add_velocity({x = (playerpos_stor[playername].x - playerpos.x) * 2, y = (playerpos_stor[playername].y - playerpos.y) * 2, z = (playerpos_stor[playername].z - playerpos.z) * 2})