mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-15 04:23:13 +03:00
Revert "Revert "Merge branch 'master' of https://github.com/EpochModTeam/DayZ-Epoch""
This reverts commit 109ec5c9a3.
This commit is contained in:
29
SQF/dayz_code/compile/mutant_findTarget.sqf
Normal file
29
SQF/dayz_code/compile/mutant_findTarget.sqf
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
_localtargets and _remotetargets are set in player_zombieCheck.
|
||||
The bloodsucker will move in the direction of the player assigned as target.
|
||||
Players with a mutant heart on tool belt will not be targeted.
|
||||
*/
|
||||
|
||||
local _mutant = _this;
|
||||
|
||||
if (isNull _mutant) exitWith {objNull}; // Prevent errors if mutant is suddenly deleted
|
||||
|
||||
local _localtargets = _mutant getVariable ["localtargets",[]];
|
||||
local _remotetargets = _mutant getVariable ["remotetargets",[]];
|
||||
local _targets = _localtargets + _remotetargets;
|
||||
|
||||
local _target = objNull;
|
||||
local _scandist = 200;
|
||||
|
||||
{
|
||||
local _skip = (DZE_MutantHeartProtect && {_x hasWeapon "ItemMutantHeart"});
|
||||
if (!_skip) then {
|
||||
local _dist = _x distance _mutant;
|
||||
if (_dist < _scandist) then {
|
||||
_target = _x;
|
||||
_scandist = _dist;
|
||||
};
|
||||
};
|
||||
} count _targets;
|
||||
|
||||
_target
|
||||
Reference in New Issue
Block a user