diff --git a/SQF/dayz_code/actions/fill_startGenerator.sqf b/SQF/dayz_code/actions/fill_startGenerator.sqf index 793ea019a..3a69ca9e8 100644 --- a/SQF/dayz_code/actions/fill_startGenerator.sqf +++ b/SQF/dayz_code/actions/fill_startGenerator.sqf @@ -1,4 +1,4 @@ -private ["_vehicle","_started","_finished","_animState","_isMedic","_soundSource"]; +private ["_vehicle","_started","_finished","_animState","_isMedic","_soundSource","_fuelCan","_emptyCan"]; if (DZE_ActionInProgress) exitWith {localize "str_epoch_player_24" call dayz_rollingMessages;}; DZE_ActionInProgress = true; @@ -49,13 +49,21 @@ if(!_finished) then { localize "str_epoch_player_26" call dayz_rollingMessages; }; +_fuelCan = nil; +{ + if (_x in magazines player) exitWith { + _fuelCan = _x; + }; +} count DayZ_fuelCans; + if (_finished) then { - // take jerry can && replace with empty + // take fuel can and replace with empty - if(!(_vehicle getVariable ["GeneratorFilled", false]) && ("ItemJerrycan" in magazines player)) then { + if(!(_vehicle getVariable ["GeneratorFilled", false]) && !isNil "_fuelCan") then { - if(([player,"ItemJerrycan"] call BIS_fnc_invRemove) == 1) then { - player addMagazine "ItemJerrycanEmpty"; + if(([player,_fuelCan] call BIS_fnc_invRemove) == 1) then { + _emptyCan = getText (configFile >> "CfgMagazines" >> _fuelCan >> "emptycan"); + player addMagazine _emptyCan; // mark as once filled _vehicle setVariable ["GeneratorFilled", true,true]; diff --git a/SQF/dayz_code/compile/fn_selfActions.sqf b/SQF/dayz_code/compile/fn_selfActions.sqf index 206f167be..f6f3a640d 100644 --- a/SQF/dayz_code/compile/fn_selfActions.sqf +++ b/SQF/dayz_code/compile/fn_selfActions.sqf @@ -485,7 +485,7 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur //destroy tents //Located in variables Dayz_Ignators = ["ItemMatchbox","Item5Matchbox","Item4Matchbox","Item3Matchbox","Item2Matchbox","Item1Matchbox"]; _hasIgnators = {_x in Dayz_Ignators} count _itemsPlayer > 0; - if ((_hasFuel20 or _hasFuel5) && _hasIgnators) then { + if ((_hasFuel20 or _hasFuel5 or _hasBarrel) && _hasIgnators) then { if (s_player_destorytent < 0) then { s_player_destorytent = player addAction [localize "str_actions_self_destorytent", "\z\addons\dayz_code\actions\player_destroyTent.sqf",_cursorTarget, 0, false, true]; }; @@ -928,7 +928,7 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur if (_cursorTarget getVariable ["GeneratorFilled", false]) then { s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR2", "\z\addons\dayz_code\actions\fill_startGenerator.sqf",_cursorTarget, 0, false, true]; } else { - if (_hasFuel20) then { + if (_hasFuel20 or _hasFuel5 or _hasBarrel) then { s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR3", "\z\addons\dayz_code\actions\fill_startGenerator.sqf",_cursorTarget, 0, false, true]; }; };