//Noise Activation
if (!(_refObj in _targets)) then {
if (_dist < (DAYZ_disAudial * 2)) then {
if ((DAYZ_disAudial * 2) > 80) then { //this line
if (!(_refObj in _targets)) then {
_targets set [count _targets, driver _refObj];
_group setVariable ["targets",_targets,true];
};
} else {
if (_dist < (DAYZ_disAudial * 4)) then {
if (!(_refObj in _targets)) then {
_targets set [count _targets, driver _refObj];
_group setVariable ["targets",_targets,true];
};
};
};
};
};
//Sight Activation
if (!(_refObj in _targets)) then {
if (_dist < (DAYZ_disVisual * 2)) then { //this line
//_chance = [_x,_dist,DAYZ_disVisual] call dayz_losChance;
//diag_log ("Visual Detection: m" + str([_x,_dist]) + " " + str(_chance));
//if ((random 1) < _chance) then {
//diag_log ("Chance Detection");
_tPos = (getPosASL _refObj);
_zPos = (getPosASL _x);
//_eyeDir = _x call dayz_eyeDir;
_eyeDir = direction _x;
_inAngle = [_zPos,_eyeDir,30,_tPos] call fnc_inAngleSector;
if (_inAngle) then {
//LOS check
_cantSee = [_x,_refObj] call dayz_losCheck;
//diag_log ("LOS Check: " + str(_cantSee));
if (!_cantSee) then {
//diag_log ("Within LOS! Target");
if (!(_refObj in _targets)) then {
_targets set [count _targets, driver _refObj];
_group setVariable ["targets",_targets,true];
};
};
};
//};
};
};
};
//diag_log ("Targets Array: " +str(_targets));