This commit is contained in:
lambdatiger 2024-01-18 18:21:39 -06:00
parent a3efede64f
commit 863692625d

View File

@ -50,24 +50,20 @@ if (_objects isEqualTo []) exitWith {
}; };
// grab crews and add them in so that targets stay approx. sorted by distance // grab crews and add them in so that targets stay approx. sorted by distance
private _targets = [];
{ {
private _crew = crew _x; private _crew = crew _x;
if (_crew isNotEqualTo []) then { _crew pushBackUnique _x;
private _arr = [_x]; _targets append _crew;
{
_arr pushBackUnique _x;
} forEach _crew;
_objects set [_forEachIndex, _arr];
};
} forEach _objects; } forEach _objects;
_objects = flatten _objects;
TRACE_3("Targets found",_posASL,_fragRange,count _objects); TRACE_3("Targets found",_posASL,_fragRange,count _targets);
// limit number of fragments per direction (2D) to 10 using _fragArcs // limit number of fragments per direction (2D) to 10 using _fragArcs
private _fragArcs = createHashMap; private _fragArcs = createHashMap;
private _totalFragCount = 0; private _totalFragCount = 0;
{ // Begin of forEach iterating on _objects { // Begin of forEach iterating on _targets
if (!alive _x) then { if (!alive _x) then {
continue; continue;
}; };
@ -168,7 +164,7 @@ private _totalFragCount = 0;
TRACE_2("maxFrags", _totalFragCount, _maxFrags); TRACE_2("maxFrags", _totalFragCount, _maxFrags);
break; break;
}; };
} forEach _objects; } forEach _targets;
#ifdef DEBUG_MODE_FULL #ifdef DEBUG_MODE_FULL
systemChat ("fragCount cnt: " + str _totalFragCount); systemChat ("fragCount cnt: " + str _totalFragCount);