mirror of
https://github.com/Teh-Dango/Sarge-AI.git
synced 2024-08-30 16:32:11 +00:00
65e4453908
Major Update. Now supporting DesolationRedux, Epoch and Exile.
31 lines
1.0 KiB
Plaintext
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; |