Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
When loading a save state in read only that mismatches the current mo…
…vie, 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.
  • Loading branch information
RachelBryk committed Jun 21, 2013
1 parent 716f656 commit 266236d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Source/Core/Core/Src/Movie.cpp
Expand Up @@ -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
{
Expand All @@ -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;
}
Expand Down

0 comments on commit 266236d

Please sign in to comment.