bug fix and direction adjusts

This commit is contained in:
Alexsandro Percy 2022-01-21 11:46:45 -03:00
parent 1325758d88
commit 7465e6b57f
2 changed files with 7 additions and 1 deletions

View File

@ -69,13 +69,16 @@ function automobiles_lib.ground_get_distances(self, radius, axis_distance)
if math.abs(math.deg(pitch) - math.deg(midpitch)) < 20 then
pitch = pitch + ((pitch - midpitch) / 2)
end
end
else
self._pitch = 0
end
if math.abs(math.deg(pitch)) <= 45 then
if math.abs(math.deg(pitch)) <= 45 and math.abs(math.deg(pitch - self._pitch)) < 20 then
self._pitch = pitch
else
self._pitch = 0
end
end

View File

@ -448,6 +448,9 @@ minetest.register_entity("automobiles_roadster:roadster", {
--control
local steering_angle_max = 30
local steering_speed = 40
if math.abs(longit_speed) > 1 then
steering_speed = steering_speed / (longit_speed/2)
end
accel, stop = automobiles_lib.control(self, dtime, hull_direction, longit_speed, longit_drag, later_drag, accel, roadster.max_acc_factor, roadster.max_speed, steering_angle_max, steering_speed)
else
if self.sound_handle ~= nil then