Disallow refueling with running engine

This commit is contained in:
GitHawk 2016-03-04 13:59:14 +01:00
parent f13517980b
commit 0b3abd55d3
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);