You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mods (complete and add to the following information):
Arma 3:x.xx [e.g. 1.00 stable, rc, dev]
CBA: fe3eba0 Make sure to reproduce the issue with only CBA on a newly created mission!
Description:
CBA_fnc_SearchNearby is susceptible to an endless loop when pathing issues occur. In the excerpt below, you can see that the position is not removed until the unit is ready. If the unit does not reach its destination, it will never be ready. Therefore one unit in a group can cause this thread to stay open forever. https://github.com/CBATeam/CBA_A3/blob/release/addons/ai/fnc_searchNearby.sqf
while {_positions isNotEqualTo []} do {
// Update units in case of death
private _units = (units _group) - [_leader];
// Abort search if the group has no units left
if (_units isEqualTo []) exitWith {};
// Send all available units to the next available position
{
if (_positions isEqualTo []) exitWith {};
if (unitReady _x) then {
private _pos = _positions deleteAt 0;
_x commandMove _pos;
sleep 2;
};
} forEach _units;
};
In my opinion, there should be a failsafe in this loop (maybe a timeout).
private _starttime = time;
private _timeout = 240; //???
... stuff
while {_positions isNotEqualTo [] && __starttime + _timeout > time} do {
// Update units in case of death
private _units = (units _group) - [_leader];
// Abort search if the group has no units left
if (_units isEqualTo []) exitWith {};
// Send all available units to the next available position
{
if (_positions isEqualTo []) exitWith {};
if (unitReady _x) then {
private _pos = _positions deleteAt 0;
_x commandMove _pos;
sleep 2;
};
} forEach _units;
};
Not sure, just need some way to break this loop if there are pathing issues.
Steps to reproduce:
Assign this task to group of 5 or more units. Eventually, they will get stuck.
Expected behavior:
Units don't get stuck... forever.
Where did the issue occur?
Self Hosted Multiplayer (probably everywhere)
Log Files:
Not applicable. No error reported.
Additional context:
I will make a PR after work with my suggestion.
The text was updated successfully, but these errors were encountered:
In the provided screenshot, all 4 units in group1 are not moving. Since the loop depends on them being ready before the waypoint lock is removed, this will never be complete.
Mods (complete and add to the following information):
x.xx
[e.g. 1.00 stable, rc, dev]Make sure to reproduce the issue with only CBA on a newly created mission!
Description:
CBA_fnc_SearchNearby is susceptible to an endless loop when pathing issues occur. In the excerpt below, you can see that the position is not removed until the unit is ready. If the unit does not reach its destination, it will never be ready. Therefore one unit in a group can cause this thread to stay open forever.
https://github.com/CBATeam/CBA_A3/blob/release/addons/ai/fnc_searchNearby.sqf
In my opinion, there should be a failsafe in this loop (maybe a timeout).
Not sure, just need some way to break this loop if there are pathing issues.
Steps to reproduce:
Expected behavior:
Where did the issue occur?
Log Files:
Additional context:
I will make a PR after work with my suggestion.
The text was updated successfully, but these errors were encountered: