diff --git a/SQF/dayz_code/actions/refuel.sqf b/SQF/dayz_code/actions/refuel.sqf index 0f7907565..c470342cb 100644 --- a/SQF/dayz_code/actions/refuel.sqf +++ b/SQF/dayz_code/actions/refuel.sqf @@ -57,6 +57,9 @@ if (!_fueling) then { r_doLoop = false; if (_finished) then { + if((_vehicle isKindOf "Generator_DZ") && {!(_vehicle getVariable ["GeneratorFilled", false])}) then { + _vehicle setVariable ["GeneratorFilled", true, true]; + }; if (local _vehicle) then { [_vehicle,_newFuel] call local_setFuel; } else { diff --git a/SQF/dayz_code/compile/fn_selfActions.sqf b/SQF/dayz_code/compile/fn_selfActions.sqf index d6c93bc92..44da314fd 100644 --- a/SQF/dayz_code/compile/fn_selfActions.sqf +++ b/SQF/dayz_code/compile/fn_selfActions.sqf @@ -835,10 +835,10 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur // check if Generator_DZ is running within 30 meters _findNearestGen = []; { - if (alive _x && (_x getVariable ["GeneratorRunning", false])) then { + if ((alive _x) && (_x getVariable ["GeneratorRunning", false])) then { _findNearestGen set [count _findNearestGen,_x]; }; - } count ([player] call FNC_getPos) nearEntities ["Generator_DZ", 30]; + } count (nearestObjects [([player] call FNC_getPos), ["Generator_DZ"], 30]); // show that pump needs power if no generator nearby. if ((count _findNearestGen) > 0) then {