1
0
mirror of https://github.com/acemod/ACE3.git synced 2024-08-30 18:23:18 +00:00
ACE3/addons/refuel/functions/fnc_getFuel.sqf
jonpas 742626ff1a
General - Relative script_component.hpp includes ()
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2023-09-12 20:58:10 +02:00

30 lines
601 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: GitHawk, Jonpas
* Get the remaining fuel amount.
*
* Arguments:
* 0: Fuel Source <OBJECT>
*
* Return Value:
* Fuel left (in liters) <NUMBER>
*
* Example:
* [fuelTruck] call ace_refuel_fnc_getFuel
*
* Public: Yes
*/
params [["_source", objNull, [objNull]]];
if (isNull _source) exitWith {0};
private _fuel = _source getVariable QGVAR(currentFuelCargo);
if (isNil "_fuel") then {
// Calling getCapacity will initialize the fuel source and return the amount of fuel in the tank
_fuel = [_source] call FUNC(getCapacity);
};
_fuel