From 25f36d93403f0994423174cafd6ee16ad8e3cfbe Mon Sep 17 00:00:00 2001 From: Josuan Albin Date: Tue, 23 Oct 2018 20:28:30 +0200 Subject: [PATCH] Improve ai garrison pathing (#6649) AI - Fix garrison pathing --- addons/ai/XEH_postInit.sqf | 2 +- addons/ai/functions/fnc_garrisonMove.sqf | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/ai/XEH_postInit.sqf b/addons/ai/XEH_postInit.sqf index 901069cff3..44f3c57472 100644 --- a/addons/ai/XEH_postInit.sqf +++ b/addons/ai/XEH_postInit.sqf @@ -22,8 +22,8 @@ params ["_unitsArray"]; { _x params ["_unit", "_pos"]; - _unit doMove _pos; _unit setDestination [_pos, "LEADER PLANNED", true]; + _unit doMove _pos; LOG_3("%1 doMove %2 | ID: %3",_unit,_pos,clientOwner); } forEach _unitsArray; }] call CBA_fnc_addEventHandler; diff --git a/addons/ai/functions/fnc_garrisonMove.sqf b/addons/ai/functions/fnc_garrisonMove.sqf index 72935ec17e..e3f32f10d6 100644 --- a/addons/ai/functions/fnc_garrisonMove.sqf +++ b/addons/ai/functions/fnc_garrisonMove.sqf @@ -99,7 +99,7 @@ if (isNil QGVAR(garrison_moveUnitPFH)) then { if (unitReady _unit) then { // Check for distance, doMove and AI are moody and may stop for no reason, within 6 meters and ready should be fine - if (_unitPos distance _pos < 3) then { + if (_unitPos distance _pos < 1.5) then { call _fnc_attemptSuccessful; } else { @@ -115,7 +115,7 @@ if (isNil QGVAR(garrison_moveUnitPFH)) then { // AI may sometimes not be able to report unitReady, this is to avoid the PFH running forever switch true do { - case ((_unitPos distance _pos) < 3) : { + case ((_unitPos distance _pos) < 1.5) : { call _fnc_attemptSuccessful; };