mirror of
https://github.com/APercy/airutils.git
synced 2025-03-15 08:01:22 +00:00
fix some fuel management
This commit is contained in:
parent
55d2266724
commit
394e9a08ba
2 changed files with 9 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue