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,28 +50,32 @@ _needNear = getArray (configFile >> "CfgMagazines" >> _item >> "ItemActions" >>
|
|||||||
{
|
{
|
||||||
_need = _x select 0;
|
_need = _x select 0;
|
||||||
_distance = _x select 1;
|
_distance = _x select 1;
|
||||||
|
switch(_need) do{
|
||||||
if("fire" in _need) then {
|
case "fire":
|
||||||
|
{
|
||||||
_isNear = {inflamed _x} count (position player nearObjects _distance);
|
_isNear = {inflamed _x} count (position player nearObjects _distance);
|
||||||
if(_isNear == 0) then {
|
if(_isNear == 0) then {
|
||||||
_abort = true;
|
_abort = true;
|
||||||
_reason = "fire";
|
_reason = "fire";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
if("workshop" in _need) then {
|
case "workshop":
|
||||||
|
{
|
||||||
_isNear = count (nearestObjects [player, ["Wooden_shed_DZ","WoodShack_DZ","WorkBench_DZ"], _distance]);
|
_isNear = count (nearestObjects [player, ["Wooden_shed_DZ","WoodShack_DZ","WorkBench_DZ"], _distance]);
|
||||||
if(_isNear == 0) then {
|
if(_isNear == 0) then {
|
||||||
_abort = true;
|
_abort = true;
|
||||||
_reason = "workshop";
|
_reason = "workshop";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
if("fueltank" in _need) then {
|
case "fueltank":
|
||||||
|
{
|
||||||
_isNear = count (nearestObjects [player, dayz_fuelsources, _distance]);
|
_isNear = count (nearestObjects [player, dayz_fuelsources, _distance]);
|
||||||
if(_isNear == 0) then {
|
if(_isNear == 0) then {
|
||||||
_abort = true;
|
_abort = true;
|
||||||
_reason = "fuel tank";
|
_reason = "fuel tank";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
} forEach _needNear;
|
} forEach _needNear;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user