Compare commits
3 Commits
5f1d7688c9
...
fix/patrol
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4ff3e5107f | ||
| f12355f581 | |||
|
|
91e3099f0e |
@@ -12,6 +12,7 @@ while {true} do {
|
||||
};
|
||||
|
||||
if !(isNil "_owner") then {
|
||||
if (_x getVariable ["KPLIB_patrol_group", false]) then {continue;};
|
||||
if !(isGroupDeletedWhenEmpty _x) then {
|
||||
if (local _x) then {
|
||||
_x deleteGroupWhenEmpty true;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
params [ "_minimum_readiness", "_is_infantry" ];
|
||||
private [ "_headless_client" ];
|
||||
private [ "_headless_client", "_grp", "_spawn_marker", "_sector_spawn_pos", "_started_time", "_patrol_continue" ];
|
||||
|
||||
waitUntil { !isNil "blufor_sectors" };
|
||||
waitUntil { !isNil "combat_readiness" };
|
||||
@@ -45,6 +45,10 @@ while { GRLIB_endgame == 0 } do {
|
||||
_grp = group ((crew _vehicle_object) select 0);
|
||||
};
|
||||
|
||||
if (!isNull _grp) then {
|
||||
_grp setVariable ["KPLIB_patrol_group", true, true];
|
||||
};
|
||||
|
||||
[_grp] spawn patrol_ai;
|
||||
|
||||
_started_time = time;
|
||||
@@ -58,6 +62,11 @@ while { GRLIB_endgame == 0 } do {
|
||||
};
|
||||
|
||||
while { _patrol_continue } do {
|
||||
if (isNil "_grp") then {
|
||||
_patrol_continue = false;
|
||||
["_grp was nil, but patrol was expected", "MANAGE_ONE_PATROL"] call KPLIB_fnc_log;
|
||||
break;
|
||||
};
|
||||
sleep 60;
|
||||
if ( count (units _grp) == 0 ) then {
|
||||
_patrol_continue = false;
|
||||
@@ -76,6 +85,15 @@ while { GRLIB_endgame == 0 } do {
|
||||
};
|
||||
};
|
||||
|
||||
if (!isNull _grp) then {
|
||||
_grp setVariable ["KPLIB_patrol_group", nil, true];
|
||||
if (local _grp) then {
|
||||
_grp deleteGroupWhenEmpty true;
|
||||
} else {
|
||||
[_grp, true] remoteExecCall ["deleteGroupWhenEmpty", groupOwner _grp];
|
||||
};
|
||||
};
|
||||
|
||||
if ( !([] call KPLIB_fnc_isBigtownActive) ) then {
|
||||
sleep (600.0 / GRLIB_difficulty_modifier);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user