removed reference for an unknown variable and consumption adjust

This commit is contained in:
Alexsandro Percy 2022-09-11 11:45:56 -03:00
parent 4752800d79
commit 427033bd2e
2 changed files with 3 additions and 3 deletions

View File

@ -252,7 +252,7 @@ minetest.register_entity("automobiles_motorcycle:motorcycle", {
local velocity = self.object:get_velocity() local velocity = self.object:get_velocity()
local longit_speed = automobiles_lib.dot(velocity,hull_direction) local longit_speed = automobiles_lib.dot(velocity,hull_direction)
local fuel_weight_factor = (5 - self._energy)/8000 local fuel_weight_factor = (5 - self._energy)/5000
local longit_drag = vector.multiply(hull_direction,(longit_speed*longit_speed) * local longit_drag = vector.multiply(hull_direction,(longit_speed*longit_speed) *
(motorcycle.LONGIT_DRAG_FACTOR - fuel_weight_factor) * -1 * automobiles_lib.sign(longit_speed)) (motorcycle.LONGIT_DRAG_FACTOR - fuel_weight_factor) * -1 * automobiles_lib.sign(longit_speed))
@ -417,7 +417,7 @@ minetest.register_entity("automobiles_motorcycle:motorcycle", {
local zero_reference = vector.new() local zero_reference = vector.new()
local acceleration = automobiles_lib.get_hipotenuse_value(accel, zero_reference) local acceleration = automobiles_lib.get_hipotenuse_value(accel, zero_reference)
--minetest.chat_send_all(acceleration) --minetest.chat_send_all(acceleration)
local consumed_power = acceleration/40000 local consumed_power = acceleration/100000
self._energy = self._energy - consumed_power; self._energy = self._energy - consumed_power;
end end
if self._energy <= 0 then if self._energy <= 0 then

View File

@ -94,7 +94,7 @@ function motorcycle.dettach_driver_stand(self, player)
end end
--player:set_properties({visual_size = {x=1, y=1}}) --player:set_properties({visual_size = {x=1, y=1}})
if driver_mesh then if self.driver_mesh then
self.driver_mesh:set_properties({is_visible=false}) self.driver_mesh:set_properties({is_visible=false})
self.driver_mesh:remove() self.driver_mesh:remove()
end end