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:
vbawol
2013-10-15 13:22:50 -07:00

View File

@@ -50,26 +50,30 @@ _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); {
if(_isNear == 0) then { _isNear = {inflamed _x} count (position player nearObjects _distance);
_abort = true; if(_isNear == 0) then {
_reason = "fire"; _abort = true;
_reason = "fire";
};
}; };
}; case "workshop":
if("workshop" in _need) then { {
_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";
};
}; };
}; case "fueltank":
if("fueltank" in _need) then { {
_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;
@@ -536,4 +540,4 @@ if (_hasrequireditem) then {
}; };
}; };
TradeInprogress = false; TradeInprogress = false;