From 0b3abd55d32cc57b885da12e624072968d731885 Mon Sep 17 00:00:00 2001 From: GitHawk Date: Fri, 4 Mar 2016 13:59:14 +0100 Subject: [PATCH] Disallow refueling with running engine --- addons/refuel/functions/fnc_canTurnOn.sqf | 3 ++- addons/refuel/functions/fnc_refuel.sqf | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/refuel/functions/fnc_canTurnOn.sqf b/addons/refuel/functions/fnc_canTurnOn.sqf index 98173e0fa4..e9de5c205c 100644 --- a/addons/refuel/functions/fnc_canTurnOn.sqf +++ b/addons/refuel/functions/fnc_canTurnOn.sqf @@ -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)))} diff --git a/addons/refuel/functions/fnc_refuel.sqf b/addons/refuel/functions/fnc_refuel.sqf index 117cf5ea1e..a1187c3954 100644 --- a/addons/refuel/functions/fnc_refuel.sqf +++ b/addons/refuel/functions/fnc_refuel.sqf @@ -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);