Commit 410780e
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 time1 parent eea4801 commit 410780e
1 file changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
129 | 131 | | |
| 132 | + | |
130 | 133 | | |
131 | 134 | | |
132 | 135 | | |
| |||
0 commit comments