mirror of
https://github.com/APercy/automobiles_pck
synced 2025-07-30 10:05:49 +02:00
fuel exception fix
This commit is contained in:
parent
db2b210b18
commit
0d164cada6
@ -1,9 +1,3 @@
|
||||
--[[
|
||||
os experimentos mostraram que a deteção de uma posição de um item atachado retorna a do objeto pai, então pegar a posição das rodas não presta
|
||||
proximo experimento sera mis complexo: pegar o yaw do carro, colocar o entreeixos e afastamento das rodas no eixo X e calcular a posição com trigonometria
|
||||
]]--
|
||||
|
||||
|
||||
--lets assume that the rear axis is at object center, so we will use the distance only for front wheels
|
||||
function automobiles.ground_get_distances(self, radius, axis_distance)
|
||||
|
||||
|
@ -531,8 +531,8 @@ minetest.register_entity("automobiles_roadster:roadster", {
|
||||
]]--
|
||||
local velocity = self.object:get_velocity()
|
||||
local speed = automobiles.get_hipotenuse_value(vector.new(), velocity)
|
||||
if self._engine_running == false and speed <= 0.1 then
|
||||
if automobiles.loadFuel(self, puncher:get_player_name(), roadster.max_fuel) then return end
|
||||
if math.abs(speed) <= 0.1 then
|
||||
if automobiles.loadFuel(self, puncher:get_player_name(), false, roadster.max_fuel) then return end
|
||||
end
|
||||
-- end refuel
|
||||
|
||||
@ -615,23 +615,6 @@ minetest.register_entity("automobiles_roadster:roadster", {
|
||||
|
||||
if name == self.driver_name then
|
||||
roadster.driver_formspec(name)
|
||||
--[[
|
||||
--detach all
|
||||
automobiles.dettach_driver(self, clicker)
|
||||
-- sound
|
||||
if self.sound_handle then
|
||||
minetest.sound_stop(self.sound_handle)
|
||||
self.sound_handle = nil
|
||||
end
|
||||
|
||||
local passenger = nil
|
||||
if self._passenger then
|
||||
passenger = minetest.get_player_by_name(self._passenger)
|
||||
if passenger then automobiles.dettach_pax(self, passenger) end
|
||||
end
|
||||
|
||||
self.object:set_acceleration(vector.multiply(automobiles.vector_up, -automobiles.gravity))
|
||||
]]--
|
||||
else
|
||||
if name == self.owner then
|
||||
--is the owner, okay, lets attach
|
||||
|
Loading…
Reference in New Issue
Block a user