comment and fix

This commit is contained in:
localhost_frssoft 2023-10-03 21:04:30 +03:00
parent 7f89f9f2e8
commit 0458d121b8
1 changed files with 8 additions and 2 deletions

View File

@ -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})