mirror of
https://github.com/APercy/automobiles_pck
synced 2025-08-26 22:56:24 +02:00
improved anti gravity correction
This commit is contained in:
parent
45c2159f91
commit
abfdf2b153
@ -827,6 +827,7 @@ minetest.register_entity("automobiles_delorean:delorean", {
|
||||
local turn_effect_speed = longit_speed
|
||||
if turn_effect_speed > 10 then turn_effect_speed = 10 end
|
||||
newroll = (-self._steering_angle/100)*(turn_effect_speed/10)
|
||||
if math.abs(self._steering_angle) < 5 then newroll = 0 end
|
||||
end
|
||||
|
||||
if newyaw~=yaw or newpitch~=pitch then self.object:set_rotation({x=newpitch,y=newyaw,z=newroll}) end
|
||||
|
@ -31,6 +31,14 @@ function delorean.gravity_auto_correction(self, dtime)
|
||||
else
|
||||
self._car_gravity = new_car_gravity
|
||||
end
|
||||
|
||||
--now desacelerate
|
||||
if self._car_gravity == 0 then
|
||||
local curr_vel = self.object:get_velocity()
|
||||
curr_vel.y = 0
|
||||
self.object:set_velocity(curr_vel)
|
||||
end
|
||||
|
||||
--minetest.chat_send_player(self.driver_name, "depois: " .. self._car_gravity)
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user