added seats and new collision detection from inside

This commit is contained in:
Alexsandro Percy 2023-03-01 21:14:37 -03:00
parent d359b5adca
commit 9378533ee4
6 changed files with 73 additions and 7 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
if math.abs(ent._longit_speed) < max_speed_anchor 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 self.isonground) or is_admin then
ent.anchored = true
ent.object:set_acceleration(vector.new())
ent.object:set_velocity(vector.new())