Sarge-AI/ModName.MapName/scripts/UPSMON/COMMON/unit/fnc/UPSMON_domove.sqf
Teh Dango 65e4453908 2.4.0
Major Update. Now supporting DesolationRedux, Epoch and Exile.
2017-12-31 03:16:37 -05:00

31 lines
1.0 KiB
Plaintext

/****************************************************************
File: UPSMON_domove.sqf
Author: MONSADA
Description:
Mueve al soldado adelante
Parameter(s):
<--- unit
<--- Distance
Returns:
nothing
****************************************************************/
private["_npc","_dir1","_targetPos","_dist"];
_npc = _this select 0;
_dist = _this select 1;
if ((count _this) > 2) then {_dir1 = _this select 2;} else{_dir1 = getDir _npc;};
sleep 0.05;
if (!alive _npc || !canmove _npc ) exitwith{};
_targetPos = [position _npc,_dir1, _dist] call UPSMON_GetPos2D;
//If position water and not boat, plane nor diver no go
if (surfaceIsWater _targetPos && { !( _npc iskindof "boat" || _npc iskindof "air" || ["diver", (typeOf (leader _npc))] call BIS_fnc_inString ) } ) exitwith
{
if (UPSMON_Debug>0) then {
diag_log format ["UPSMON 'UPSMON_domove' exit: targetPos is water: [%1] - [%2] - [%3]", _npc iskindof 'boat', _npc iskindof 'air', ['diver', (typeOf (leader _npc))] call BIS_fnc_inString];
};
};
_npc doMove _targetPos;