2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2015-08-13 17:33:55 +00:00
|
|
|
/*
|
2015-08-16 23:57:05 +00:00
|
|
|
* Author: GitHawk, Jonpas
|
|
|
|
* Get the remaining fuel amount.
|
2015-08-13 17:33:55 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
2017-09-10 19:43:03 +00:00
|
|
|
* 0: Fuel Source <OBJECT>
|
2015-08-13 17:33:55 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
2015-08-14 01:18:54 +00:00
|
|
|
* Fuel left (in liters) <NUMBER>
|
2015-08-13 17:33:55 +00:00
|
|
|
*
|
|
|
|
* Example:
|
2015-08-21 20:43:45 +00:00
|
|
|
* [fuelTruck] call ace_refuel_fnc_getFuel
|
2015-08-13 17:33:55 +00:00
|
|
|
*
|
2016-02-26 09:50:02 +00:00
|
|
|
* Public: Yes
|
2015-08-13 17:33:55 +00:00
|
|
|
*/
|
|
|
|
|
2017-09-10 19:43:03 +00:00
|
|
|
params [["_source", objNull, [objNull]]];
|
2015-08-14 01:18:54 +00:00
|
|
|
|
2017-09-10 19:43:03 +00:00
|
|
|
if (isNull _source) exitWith {0};
|
2016-02-26 09:50:02 +00:00
|
|
|
|
2017-09-10 19:43:03 +00:00
|
|
|
private _fuel = _source getVariable QGVAR(currentFuelCargo);
|
2015-08-13 17:33:55 +00:00
|
|
|
|
2015-08-16 23:57:05 +00:00
|
|
|
if (isNil "_fuel") then {
|
2023-02-17 02:06:11 +00:00
|
|
|
// Calling getCapacity will initialize the fuel source and return the amount of fuel in the tank
|
|
|
|
_fuel = [_source] call FUNC(getCapacity);
|
2015-08-13 17:33:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
_fuel
|