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

@@ -282,6 +282,8 @@ class ItemFuelBarrel: CA_Magazine
model = "\z\addons\dayz_epoch\models\oil_drum_model.p3d";
picture = "\z\addons\dayz_epoch\pictures\equip_oil_drum_model_ca.paa";
descriptionShort = "210 litres of fuel per barrel";
fireIntensity = 6; //used for tent burning
emptycan = "ItemFuelBarrelEmpty";
};
class ItemFuelBarrelEmpty: ItemFuelBarrel
{
@@ -292,6 +294,7 @@ class ItemFuelBarrelEmpty: ItemFuelBarrel
displayName = "Fuel Barrel (Empty)";
picture = "\z\addons\dayz_epoch\pictures\equip_oildrum_e_CA.paa";
descriptionShort = "210 litres of fuel per barrel (Empty)";
fullcan = "ItemFuelBarrel";
class ItemActions {
class Crafting
{

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

View File

@@ -289,10 +289,20 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur
};
if (damage _cursorTarget < 1) then {
//Allow player to fill vehicle 210L
if (_hasBarrel && {!_isZombie} && {!_isAnimal} && {!_isMan} && {_isVehicle or _isGenerator} && {fuel _cursorTarget < 1} && {!a_player_jerryfilling} && {!_isDisallowRefuel}) then {
if (s_player_fillfuel210 < 0) then {
s_player_fillfuel210 = player addAction [format[localize "str_actions_medical_10",_text,"210"], "\z\addons\dayz_code\actions\refuel.sqf",["ItemFuelBarrel",_cursorTarget], 0, true, true, "", "'ItemFuelBarrel' in magazines player"];
};
} else {
player removeAction s_player_fillfuel210;
s_player_fillfuel210 = -1;
};
//Allow player to fill vehicle 20L
if ((_hasFuel20 or _hasBarrel) && {!_isZombie} && {!_isAnimal} && {!_isMan} && {_isVehicle or _isGenerator} && {fuel _cursorTarget < 1} && {!a_player_jerryfilling} && {!_isDisallowRefuel}) then {
if (_hasFuel20 && {!_isZombie} && {!_isAnimal} && {!_isMan} && {_isVehicle or _isGenerator} && {fuel _cursorTarget < 1} && {!a_player_jerryfilling} && {!_isDisallowRefuel}) then {
if (s_player_fillfuel20 < 0) then {
s_player_fillfuel20 = player addAction [format[localize "str_actions_medical_10",_text,"20"], "\z\addons\dayz_code\actions\refuel.sqf",["ItemJerrycan"], 0, true, true, "", "(('ItemJerrycan' in magazines player) or ('ItemFuelBarrel' in magazines player))"];
s_player_fillfuel20 = player addAction [format[localize "str_actions_medical_10",_text,"20"], "\z\addons\dayz_code\actions\refuel.sqf",["ItemJerrycan",_cursorTarget], 0, true, true, "", "'ItemJerrycan' in magazines player"];
};
} else {
player removeAction s_player_fillfuel20;
@@ -300,9 +310,9 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur
};
//Allow player to fill vehicle 5L
if (_hasFuel5 && {!_isZombie} && {!_isAnimal} && {!_isMan} && {_isVehicle or _isGenerator} && {fuel _cursorTarget < 1} && {!a_player_jerryfilling}) then {
if (_hasFuel5 && {!_isZombie} && {!_isAnimal} && {!_isMan} && {_isVehicle or _isGenerator} && {fuel _cursorTarget < 1} && {!a_player_jerryfilling} && {!_isDisallowRefuel}) then {
if (s_player_fillfuel5 < 0) then {
s_player_fillfuel5 = player addAction [format[localize "str_actions_medical_10",_text,"5"], "\z\addons\dayz_code\actions\refuel.sqf",["ItemFuelcan"], 0, true, true, "", "'ItemFuelcan' in magazines player"];
s_player_fillfuel5 = player addAction [format[localize "str_actions_medical_10",_text,"5"], "\z\addons\dayz_code\actions\refuel.sqf",["ItemFuelcan",_cursorTarget], 0, true, true, "", "'ItemFuelcan' in magazines player"];
};
} else {
player removeAction s_player_fillfuel5;
@@ -325,6 +335,8 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur
s_player_siphonfuel = -1;
};
} else {
player removeAction s_player_fillfuel210;
s_player_fillfuel210 = -1;
player removeAction s_player_fillfuel20;
s_player_fillfuel20 = -1;
player removeAction s_player_fillfuel5;
@@ -1017,6 +1029,8 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur
player removeAction s_player_studybody;
s_player_studybody = -1;
//fuel
player removeAction s_player_fillfuel210;
s_player_fillfuel210 = -1;
player removeAction s_player_fillfuel20;
s_player_fillfuel20 = -1;
player removeAction s_player_fillfuel5;

View File

@@ -175,6 +175,7 @@ dayz_resetSelfActions = {
s_player_flipveh = -1;
s_player_stats = -1;
s_player_sleep = -1;
s_player_fillfuel210 = -1;
s_player_fillfuel20 = -1;
s_player_fillfuel5 = -1;
s_player_siphonfuel = -1;

View File

@@ -1349,22 +1349,6 @@
<French>Un tuyau serait nécessaire pour ce faire.</French>
<German>Dafür brauchst du einen Schlauch.</German>
</Key>
<Key ID="str_siphon_notvehicle">
<English>You can only siphon the fuel from a vehicle!</English>
<Russian>Сливать топливо можно только из транспорта!</Russian>
<Spanish>Sólo se puede desviar el combustible de un vehículo!</Spanish>
<Czech>Palivo lze přečerpávat pouze z vozidla!</Czech>
<French>Vous ne pouvez siphonner du carburant que d&apos;un véhicule!</French>
<German>Du kannst nur aus einem Fahrzeug Treibstoff abzapfen.</German>
</Key>
<Key ID="str_refuel_notvehicle">
<English>You can only refuel a vehicle!</English>
<Russian>Заправлять можно только транспорт!</Russian>
<Spanish>Sólo se puede repostar un vehículo!</Spanish>
<Czech>Můžete dotankovat pouze vozidla!</Czech>
<French>Vous ne pouvez faire le plein que d&apos;un véhicule!</French>
<German>Du kannst nur ein Fahrzeug auftanken.</German>
</Key>
<Key ID="str_setFireMatches">
<English>Unable to set on fire, missing matches.</English>
<Russian>Нечем разжечь огонь. Может найти спички?</Russian>