mirror of
https://github.com/APercy/airutils.git
synced 2025-03-21 18:41:21 +00:00
added parameter to interfere in fuel consumption
This commit is contained in:
parent
22fe149890
commit
eec66cabd9
1 changed files with 3 additions and 1 deletions
|
@ -37,7 +37,9 @@ end
|
||||||
function airutils.consumptionCalc(self, accel)
|
function airutils.consumptionCalc(self, accel)
|
||||||
if accel == nil then return end
|
if accel == nil then return end
|
||||||
if self._energy > 0 and self._engine_running and accel ~= nil then
|
if self._energy > 0 and self._engine_running and accel ~= nil then
|
||||||
local consumed_power = self._power_lever/700000
|
local divisor = 700000
|
||||||
|
if self._fuel_consumption_divisor then divisor = self._fuel_consumption_divisor end
|
||||||
|
local consumed_power = self._power_lever/divisor
|
||||||
--minetest.chat_send_all('consumed: '.. consumed_power)
|
--minetest.chat_send_all('consumed: '.. consumed_power)
|
||||||
self._energy = self._energy - consumed_power;
|
self._energy = self._energy - consumed_power;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue