Skip to content

Commit 2ca044d

Browse files
authored
feat: track groupID and side dynamically per unit state update (#55)
* feat: track groupID and side dynamically per unit state update Appends groupID and side to the :NEW:SOLDIER:STATE: data array (indices 16-17) so group changes mid-mission are captured. Refs OCAP2/OCAP#5 * perf: cache group lookup in unit state update Avoids calling `group _x` twice per unit per frame in the capture loop.
1 parent 14a20b7 commit 2ca044d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

addons/recorder/fnc_captureLoop.sqf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ GVAR(PFHObject) = [
135135
};
136136

137137
_pos = getPosASL _x;
138+
private _unitGroup = group _x;
138139

139140
private _unitData = [
140141
(_x getVariable QGVARMAIN(id)), //1
@@ -151,7 +152,9 @@ GVAR(PFHObject) = [
151152
(getPlayerScores _x) joinString ",", // scores 12
152153
_x call CBA_fnc_vehicleRole, // vehicle role 13
153154
if (!isNull objectParent _x) then {(objectParent _x) getVariable [QGVARMAIN(id), -1]} else {-1}, // 14
154-
stance _x // 15
155+
stance _x, // 15
156+
groupID _unitGroup, // 16 group name (dynamic)
157+
str side _unitGroup // 17 side (dynamic)
155158
];
156159

157160
if (_x getVariable ["unitData", []] isNotEqualTo _unitData) then {

0 commit comments

Comments
 (0)