diff --git a/src/BizHawk.Client.Common/savestates/SavestateFile.cs b/src/BizHawk.Client.Common/savestates/SavestateFile.cs index 347409a593..763f438c3d 100644 --- a/src/BizHawk.Client.Common/savestates/SavestateFile.cs +++ b/src/BizHawk.Client.Common/savestates/SavestateFile.cs @@ -125,13 +125,27 @@ namespace BizHawk.Client.Common } } - public bool Load(string path) + public bool Load(string path, IDialogParent dialogParent) { // try to detect binary first using var bl = ZipStateLoader.LoadAndDetect(path); if (bl is null) return false; var succeed = false; + if (!VersionInfo.DeveloperBuild) + { + bl.GetLump(BinaryStateLump.BizVersion, true, tr => succeed = tr.ReadLine() == VersionInfo.GetEmuVersion()); + if (!succeed) + { + var result = dialogParent.ModalMessageBox2( + "This savestate was made with a different version, so it's unlikely to work.\nChoose OK to try loading it anyway.", + "Savestate version mismatch", + EMsgBoxIcon.Question, + useOKCancel: true); + if (!result) return false; + } + } + // Movie timeline check must happen before the core state is loaded if (_movieSession.Movie.IsActive()) { diff --git a/src/BizHawk.Client.EmuHawk/MainForm.cs b/src/BizHawk.Client.EmuHawk/MainForm.cs index 906f56f330..566860d85b 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.cs @@ -4176,7 +4176,7 @@ namespace BizHawk.Client.EmuHawk return; } - if (new SavestateFile(Emulator, MovieSession, QuickBmpFile, MovieSession.UserBag).Load(path)) + if (new SavestateFile(Emulator, MovieSession, QuickBmpFile, MovieSession.UserBag).Load(path, this)) { OSD.ClearGuiText(); EmuClient.OnStateLoaded(this, userFriendlyStateName);