When loading a save state in read only that mismatches the current movie, load the input prior to the save state from the save state's movie, instead of using the current movie's input up to that point.

This prevents desyncing before the save state.
This commit is contained in:
Rachel Bryk 2013-06-21 01:53:50 -04:00
parent 716f656d28
commit 266236d6a4
1 changed files with 3 additions and 0 deletions

View File

@ -850,6 +850,7 @@ void LoadInput(const char *filename)
{
// TODO: more detail
PanicAlertT("Warning: You loaded a save whose movie mismatches on byte %d (0x%X). You should load another save before continuing, or load this state with read-only mode off. Otherwise you'll probably get a desync.", i+256, i+256);
memcpy(tmpInput, movInput, g_currentByte);
}
else
{
@ -871,6 +872,8 @@ void LoadInput(const char *filename)
(int)curPadState.Start, (int)curPadState.A, (int)curPadState.B, (int)curPadState.X, (int)curPadState.Y, (int)curPadState.Z, (int)curPadState.DPadUp, (int)curPadState.DPadDown, (int)curPadState.DPadLeft, (int)curPadState.DPadRight, (int)curPadState.L, (int)curPadState.R, (int)curPadState.TriggerL, (int)curPadState.TriggerR, (int)curPadState.AnalogStickX, (int)curPadState.AnalogStickY, (int)curPadState.CStickX, (int)curPadState.CStickY,
(int)frame,
(int)movPadState.Start, (int)movPadState.A, (int)movPadState.B, (int)movPadState.X, (int)movPadState.Y, (int)movPadState.Z, (int)movPadState.DPadUp, (int)movPadState.DPadDown, (int)movPadState.DPadLeft, (int)movPadState.DPadRight, (int)movPadState.L, (int)movPadState.R, (int)movPadState.TriggerL, (int)movPadState.TriggerR, (int)movPadState.AnalogStickX, (int)movPadState.AnalogStickY, (int)movPadState.CStickX, (int)movPadState.CStickY);
memcpy(tmpInput, movInput, g_currentByte);
}
break;
}