Skip to content

Commit 410780e

Browse files
authored
fix: entity removal for excluded entities (disconnect, respawn) (#86)
* fix: entities vanish in playback due to sparse position data The dedup optimization only sends state updates when data changes, but excluded entities (disconnected players, respawn corpses) stop producing states abruptly — the extension's gap-fill has no final state to extend. - Disconnect: stop excluding the unit body so it continues being tracked as AI. The capture loop's reconnect logic handles re-inclusion. - Respawn: send a final lifeState=0 state for the corpse before excluding it, so the extension knows the corpse's last frame for gap-filling. Companion to OCAP2/extension#134. * fix: add type check before copying unitData on respawn Guard against potential script error if unitData is unexpectedly a non-array type by checking isEqualType before using the + copy operator. * fix: send final dead state on disconnect before excluding Restores exclude=true so disconnected player bodies stop being tracked, but first sends a final lifeState=0 state so the extension knows the entity's last frame. Combined with the extension's dead-entity handling, the unit properly disappears from playback at the disconnect frame. * fix: report entity deletion instead of faking dead state Send :SOLDIER:DELETE: on disconnect and respawn instead of injecting a fake dead state. The extension now owns the gap-fill boundary logic. * fix: skip DELETE for respawnOnStart where entity == corpse respawnOnStart reuses the same unit object, so _entity == _corpse in the EntityRespawned handler. Sending DELETE in this case caused the entity to be prematurely removed in streaming mode while the capture loop re-included it on the next frame. * debug: log settings snapshot at init and allow frameCaptureDelay down to 0.1 * debug: log before and after MISSION:SAVE with elapsed time
1 parent eea4801 commit 410780e

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

addons/recorder/fnc_exportData.sqf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,10 @@ private _endMessage = if (isNil "_message") then {if (_winSide == "") then {"Mis
126126

127127

128128
private _saveTag = if (!isNil "_tag") then {_tag} else {EGVAR(settings,saveTag)};
129+
INFO_3("Saving recording — mission: %1 | frames: %2 | tag: %3",GVAR(missionName),_endFrameNumber,_saveTag);
130+
private _saveStart = diag_tickTime;
129131
[":MISSION:SAVE:", [worldName, GVAR(missionName), getMissionConfigValue ["author", ""], GVAR(frameCaptureDelay), _endFrameNumber, _saveTag]] call EFUNC(extension,sendData);
132+
INFO_2("Recording saved — took %1 ms | mission: %2",round ((diag_tickTime - _saveStart) * 1000),GVAR(missionName));
130133
OCAPEXTLOG(ARR4("Saved recording of mission",GVAR(missionName),"with tag",_saveTag));
131134

132135

0 commit comments

Comments
 (0)