mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 20:13:13 +03:00
Update dayz_losCheck
Made by @Victor-the-Cleaner
This commit is contained in:
@@ -329,23 +329,16 @@ if (!isDedicated) then {
|
|||||||
};
|
};
|
||||||
|
|
||||||
dayz_losCheck = {
|
dayz_losCheck = {
|
||||||
private ["_cantSee","_target","_agent"];
|
local _target = _this select 0;
|
||||||
_target = _this select 0; // PUT THE PLAYER IN FIRST ARGUMENT!!!!
|
local _agent = _this select 1;
|
||||||
_agent = _this select 1;
|
local _cantSee = true;
|
||||||
_cantSee = true;
|
|
||||||
|
|
||||||
if ((!isNull _target) && {!isNull _agent}) then {
|
if ((!isNull _target) && {!isNull _agent}) then {
|
||||||
private ["_tPos","_zPos"];
|
local _los = [eyePos _target, eyePos _agent]; // [player, zombie]
|
||||||
_tPos = eyePos _target;
|
_cantSee = lineIntersects _los;
|
||||||
_zPos = eyePos _agent;
|
|
||||||
if ((count _tPos > 0) && {count _zPos > 0}) then {
|
|
||||||
_cantSee = terrainIntersectASL [(eyePos _target), (eyePos _agent)];
|
|
||||||
//diag_log ("terrainIntersectASL: " + str(_cantSee));
|
|
||||||
|
|
||||||
if (!_cantSee) then {
|
if (!_cantSee) then {
|
||||||
_cantSee = lineIntersects [(eyePos _target), (eyePos _agent)];
|
_cantSee = terrainIntersectASL _los;
|
||||||
//diag_log ("lineIntersects: " + str(_cantSee));
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
_cantSee
|
_cantSee
|
||||||
|
|||||||
Reference in New Issue
Block a user