fixed ruberband bug on versions above 5.8

This commit is contained in:
Alexsandro Percy 2024-11-16 13:08:09 -03:00
parent 0e3e043c8a
commit e2c219160e
2 changed files with 6 additions and 10 deletions

View File

@ -3,21 +3,21 @@ initial_properties = {
physical = false,
collide_with_objects=false,
pointable=false,
visual = "sprite",
visual = "mesh",
mesh = "automobiles_pivot_mesh.b3d",
textures = {"automobiles_alpha.png",},
use_texture_alpha = true,
},
on_activate = function(self,std)
self.sdata = minetest.deserialize(std) or {}
if self.sdata.remove then self.object:remove() end
end,
get_staticdata=function(self)
self.sdata.remove=true
return minetest.serialize(self.sdata)
end,
})
minetest.register_entity('automobiles_lib:pointer',{
@ -746,7 +746,5 @@ function automobiles_lib.on_step(self, dtime)
self.object:set_rotation({x=newpitch,y=newyaw,z=newroll})
--saves last velocity for collision detection (abrupt stop)
self.lastvelocity = self.object:get_velocity()
self._longit_speed = longit_speed
end

View File

@ -147,7 +147,7 @@ function automobiles_lib.get_box_height(self)
end
function automobiles_lib.stepfunc(self,dtime,colinfo)
self.dtime = min(dtime,0.2)
self.dtime = math.min(dtime,0.2)
self.colinfo = colinfo
self.height = automobiles_lib.get_box_height(self)
@ -167,9 +167,7 @@ function automobiles_lib.stepfunc(self,dtime,colinfo)
self:physics()
if self.logic then
if self.view_range then self:sensefunc() end
self:logic()
execute_queues(self)
end
self.lastvelocity = self.object:get_velocity()