mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-15 13:26:39 +03:00
Merge pull request #593 from ctcDNightmare/patch-2
Check for _needNear produces errors because "X" in _array can't be used ... Thanks
This commit is contained in:
@@ -50,26 +50,30 @@ _needNear = getArray (configFile >> "CfgMagazines" >> _item >> "ItemActions" >>
|
||||
{
|
||||
_need = _x select 0;
|
||||
_distance = _x select 1;
|
||||
|
||||
if("fire" in _need) then {
|
||||
_isNear = {inflamed _x} count (position player nearObjects _distance);
|
||||
if(_isNear == 0) then {
|
||||
_abort = true;
|
||||
_reason = "fire";
|
||||
switch(_need) do{
|
||||
case "fire":
|
||||
{
|
||||
_isNear = {inflamed _x} count (position player nearObjects _distance);
|
||||
if(_isNear == 0) then {
|
||||
_abort = true;
|
||||
_reason = "fire";
|
||||
};
|
||||
};
|
||||
};
|
||||
if("workshop" in _need) then {
|
||||
_isNear = count (nearestObjects [player, ["Wooden_shed_DZ","WoodShack_DZ","WorkBench_DZ"], _distance]);
|
||||
if(_isNear == 0) then {
|
||||
_abort = true;
|
||||
_reason = "workshop";
|
||||
case "workshop":
|
||||
{
|
||||
_isNear = count (nearestObjects [player, ["Wooden_shed_DZ","WoodShack_DZ","WorkBench_DZ"], _distance]);
|
||||
if(_isNear == 0) then {
|
||||
_abort = true;
|
||||
_reason = "workshop";
|
||||
};
|
||||
};
|
||||
};
|
||||
if("fueltank" in _need) then {
|
||||
_isNear = count (nearestObjects [player, dayz_fuelsources, _distance]);
|
||||
if(_isNear == 0) then {
|
||||
_abort = true;
|
||||
_reason = "fuel tank";
|
||||
case "fueltank":
|
||||
{
|
||||
_isNear = count (nearestObjects [player, dayz_fuelsources, _distance]);
|
||||
if(_isNear == 0) then {
|
||||
_abort = true;
|
||||
_reason = "fuel tank";
|
||||
};
|
||||
};
|
||||
};
|
||||
} forEach _needNear;
|
||||
|
||||
Reference in New Issue
Block a user