- always do CalcInGameCutsceneSize (avoid crash when replay is loaded if mission cutscenes are present)

This commit is contained in:
Ilya Shurumov 2021-05-22 20:25:03 +06:00 committed by InspirationByte
parent 5315ff4be6
commit 252c1c2aa5
2 changed files with 6 additions and 3 deletions

View File

@ -427,7 +427,7 @@ void ComputeCarLightingLevels(CAR_DATA* cp, char detail)
norms = (SVECTOR*)model->point_normals; norms = (SVECTOR*)model->point_normals;
ppads = gTempCarVertDump[cp->id]; ppads = gTempCarVertDump[cp->id];
count = num_norms + 1; count = num_norms;// +1;
while (count >= 0) while (count >= 0)
{ {

View File

@ -47,9 +47,12 @@ void InitPadRecording(void)
{ {
char *bufferEnd; char *bufferEnd;
int remain; int remain, cutsSize;
int i; int i;
// initialize chases
cutsSize = CalcInGameCutsceneSize();
gOutOfTape = 0; gOutOfTape = 0;
if (gLoadedReplay == 0 && if (gLoadedReplay == 0 &&
@ -72,7 +75,7 @@ void InitPadRecording(void)
// FIXME: is that correct? // FIXME: is that correct?
bufferEnd = replayptr-13380; bufferEnd = replayptr-13380;
remain = (u_int)ReplayStart - (u_int)bufferEnd - CalcInGameCutsceneSize(); remain = (u_int)ReplayStart - (u_int)bufferEnd - cutsSize;
for (i = 0; i < NumPlayers; i++) for (i = 0; i < NumPlayers; i++)
{ {