fix some fuel management

This commit is contained in:
Alexsandro Percy 2024-01-28 18:42:17 -03:00
parent 55d2266724
commit 394e9a08ba
2 changed files with 9 additions and 2 deletions

View file

@ -321,7 +321,7 @@ function airutils.logic_heli(self)
if self._engine_running == false then fixed_power = 0 end
local power_indicator_angle = airutils.get_gauge_angle(fixed_power/10) + 90
local fuel_in_percent = (self._energy * 1)/self._max_fuel
local energy_indicator_angle = (180*fuel_in_percent)-180 --(airutils.get_gauge_angle((self._max_fuel - self._energy)*2)) - 90
local energy_indicator_angle = (180*fuel_in_percent)-180
if is_attached then
if self._show_hud then

View file

@ -40,7 +40,14 @@ function airutils.consumptionCalc(self, accel)
if self._energy > 0 and self._engine_running and accel ~= nil then
local divisor = 700000
if self._fuel_consumption_divisor then divisor = self._fuel_consumption_divisor end
local consumed_power = self._power_lever/divisor
local consumed_power = 0
if self._rotor_speed then
--is an helicopter
consumed_power = 50/divisor --fixed rpm
else
--is a normal plane
consumed_power = self._power_lever/divisor
end
--minetest.chat_send_all('consumed: '.. consumed_power)
self._energy = self._energy - consumed_power;