fixes and priv to anchor added

This commit is contained in:
Alexsandro Percy 2023-03-03 21:20:12 -03:00
parent 9c2b1a84cc
commit 232f5df95f
3 changed files with 16 additions and 4 deletions

View file

@ -229,8 +229,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
if fields.anchor == "true" then
local max_speed_anchor = 0.6
if ent._longit_speed then
local is_admin = minetest.check_player_privs(player, {server=true}) --force stop by admins
if (math.abs(ent._longit_speed) < max_speed_anchor and ent.isonground) or is_admin then
local can_anchor = minetest.check_player_privs(player, {ap_airship_anchor=true}) --force stop
if (math.abs(ent._longit_speed) < max_speed_anchor and ent.isonground) or can_anchor then
ent.anchored = true
ent.object:set_acceleration(vector.new())
ent.object:set_velocity(vector.new())