Improve ai garrison pathing (#6649)

AI - Fix garrison pathing
This commit is contained in:
Josuan Albin 2018-10-23 20:28:30 +02:00 committed by PabstMirror
parent b8d4f981b2
commit 25f36d9340
2 changed files with 3 additions and 3 deletions

View File

@ -22,8 +22,8 @@
params ["_unitsArray"]; params ["_unitsArray"];
{ {
_x params ["_unit", "_pos"]; _x params ["_unit", "_pos"];
_unit doMove _pos;
_unit setDestination [_pos, "LEADER PLANNED", true]; _unit setDestination [_pos, "LEADER PLANNED", true];
_unit doMove _pos;
LOG_3("%1 doMove %2 | ID: %3",_unit,_pos,clientOwner); LOG_3("%1 doMove %2 | ID: %3",_unit,_pos,clientOwner);
} forEach _unitsArray; } forEach _unitsArray;
}] call CBA_fnc_addEventHandler; }] call CBA_fnc_addEventHandler;

View File

@ -99,7 +99,7 @@ if (isNil QGVAR(garrison_moveUnitPFH)) then {
if (unitReady _unit) 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 // 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; call _fnc_attemptSuccessful;
} else { } 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 // AI may sometimes not be able to report unitReady, this is to avoid the PFH running forever
switch true do { switch true do {
case ((_unitPos distance _pos) < 3) : { case ((_unitPos distance _pos) < 1.5) : {
call _fnc_attemptSuccessful; call _fnc_attemptSuccessful;
}; };