Skip to content

Commit 4db2219

Browse files
committed
- cutscene recorder always finalize last ping
- clear cutscene buffer on restart
1 parent f6f7c0c commit 4db2219

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

src_rebuild/Game/C/cutrecorder.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,14 +225,20 @@ int CutRec_StorePingInfo(int cookieCount, int carId)
225225
if (CurrentGameMode == GAMEMODE_REPLAY || gInGameChaseActive != 0)
226226
return 0;
227227

228-
if (PingBuffer != NULL && PingBufferPos < MAX_REPLAY_PINGS)
228+
if (PingBuffer != NULL && PingBufferPos < MAX_REPLAY_PINGS-1)
229229
{
230230
packet = &PingBuffer[PingBufferPos++];
231231
packet->frame = CameraCnt - frameStart;
232232
packet->carId = carId;
233233

234234
packet->cookieCount = cookieCount;
235235

236+
// always finalize last ping
237+
packet = &PingBuffer[PingBufferPos];
238+
packet->frame = 0xffff;
239+
packet->carId = -1;
240+
packet->cookieCount = -1;
241+
236242
return 1;
237243
}
238244

src_rebuild/Game/C/cutscene.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,8 @@ int CalcInGameCutsceneSize(void)
470470
CutsceneBuffer.buffer = D_MALLOC(CutsceneBuffer.reservedSize);
471471
}
472472

473+
ClearMem(CutsceneBuffer.buffer, CutsceneBuffer.reservedSize);
474+
473475
return CutsceneHeader.maxsize;
474476
}
475477

0 commit comments

Comments
 (0)