Merge pull request #3534 from GitHawk/refuel_isEngineOn

Disallow refueling with running engine
This commit is contained in:
Thomas Kooi 2016-03-08 19:20:28 +01:00
commit ddd8187b19
2 changed files with 5 additions and 1 deletions

View File

@ -27,4 +27,5 @@ if (isNull _unit ||
!(_nozzle getVariable [QGVAR(isRefueling), false]) &&
{[_nozzle getVariable QGVAR(source)] call FUNC(getFuel) != 0} &&
{!isNull (_nozzle getVariable [QGVAR(sink), objNull])} &&
{(fuel (_nozzle getVariable QGVAR(sink))) < 1}
{(fuel (_nozzle getVariable QGVAR(sink))) < 1} &&
{!(isEngineOn (_nozzle getVariable QGVAR(sink)))}

View File

@ -52,6 +52,9 @@ private _maxFuel = getNumber (configFile >> "CfgVehicles" >> (typeOf _target) >>
private _finished = false;
private _fueling = _nozzle getVariable [QGVAR(isRefueling), false];
if (_fueling) then {
if (isEngineOn _sink) exitWith {
_nozzle setVariable [QGVAR(isRefueling), false, true];
};
private _fuelInSource = [_source] call FUNC(getFuel);
if (_fuelInSource == 0) exitWith {
[LSTRING(Hint_SourceEmpty), 2, _unit] call EFUNC(common,displayTextStructured);