Fix siphon fuel

ItemJerrycanEmpty no longer inherits from ItemJerrycan
This commit is contained in:
ebaydayz
2016-04-22 17:39:52 -04:00
parent 3c52278e4d
commit 1879fb8707
6 changed files with 33 additions and 40 deletions

View File

@@ -1,11 +1,11 @@
if (DZE_ActionInProgress) exitWith {localize "str_epoch_player_24" call dayz_rollingMessages;};
DZE_ActionInProgress = true;
private ["_vehicle","_canSize","_configVeh","_capacity","_nameType","_curFuel","_newFuel","_dis","_sfx","_fueling","_array","_cantype",
"_emptycan","_isMan","_isAnimal","_isZombie","_started","_finished","_animState","_isRefuel"];
"_emptycan","_started","_finished","_animState","_isRefuel"];
_vehicle = cursorTarget;
_array = _this select 3;
_cantype = _array select 0;
_vehicle = _array select 1;
_canSize = getNumber(configFile >> "cfgMagazines" >> _cantype >> "fuelQuantity");
_emptycan = getText(configFile >> "cfgMagazines" >> _cantype >> "emptycan");
_configVeh = configFile >> "cfgVehicles" >> TypeOf(_vehicle);
@@ -14,11 +14,7 @@ _nameType = getText(_configVeh >> "displayName");
_curFuel = ((fuel _vehicle) * _capacity);
_newFuel = (_curFuel + _canSize);
_fueling = player getVariable ["fueling",false];
_isMan = _vehicle isKindOf "Man";
_isAnimal = _vehicle isKindOf "Animal";
_isZombie = _vehicle isKindOf "zZombie_base";
if (_isMan or _isAnimal or _isZombie) exitWith { localize "str_refuel_notvehicle" call dayz_rollingMessages; DZE_ActionInProgress = false;};
if (fuel _vehicle == 1) exitWith {DZE_ActionInProgress = false;};
player removeAction s_player_fillfuel + _capacity;

View File

@@ -1,7 +1,8 @@
private ["_vehicle","_curFuel","_newFuel","_started","_finished","_animState","_isMedic","_location1","_location2","_abort",
"_canNameEmpty","_canSizeEmpty","_canTypeEmpty","_canName","_canSize","_configCanEmpty","_configVeh","_capacity","_nameText",
"_availableCansEmpty","_hasHose","_PlayerNear","_isMan","_isAnimal","_isZombie"];
"_availableCansEmpty","_hasHose","_PlayerNear"];
_vehicle = _this select 3;
player removeAction s_player_siphonfuel;
_hasHose = "equip_hose" in magazines player;
@@ -11,18 +12,12 @@ _PlayerNear = {isPlayer _x} count ((getPosATL _vehicle) nearEntities ["CAManBase
if (_PlayerNear) exitWith {localize "str_pickup_limit_5" call dayz_rollingMessages;};
dayz_siphonFuelInProgress = true;
_vehicle = _this select 3;
_abort = false;
// Static vehicle fuel information
_configVeh = configFile >> "cfgVehicles" >> typeOf _vehicle;
_capacity = getNumber(_configVeh >> "fuelCapacity");
_nameText = getText(_configVeh >> "displayName");
_isMan = _vehicle isKindOf "Man";
_isAnimal = _vehicle isKindOf "Animal";
_isZombie = _vehicle isKindOf "zZombie_base";
if (_isMan or _isAnimal or _isZombie) exitWith { localize "str_siphon_notvehicle" call dayz_rollingMessages; };
// Loop to find containers that can could hold fuel and fill them
{
@@ -35,7 +30,7 @@ if (_isMan or _isAnimal or _isZombie) exitWith { localize "str_siphon_notvehicle
_canTypeEmpty = getText(_configCanEmpty >> "displayName");
// Get Full can size
_canName = configName(inheritsFrom(configFile >> "cfgMagazines" >> _canNameEmpty));
_canName = getText(_configCanEmpty >> "fullCan");
_canSize = getNumber(configFile >> "cfgMagazines" >> _canName >> "fuelQuantity");
// is empty