Browse Source

Version bump. Fixed crash on desync saves.

Michał W. Urbańczyk 12 years ago
parent
commit
9492592a8f
2 changed files with 10 additions and 8 deletions
  1. 9 7
      lib/Connection.cpp
  2. 1 1
      lib/GameConstants.h

+ 9 - 7
lib/Connection.cpp

@@ -509,15 +509,17 @@ int CLoadIntegrityValidator::read( const void * data, unsigned size )
 
 	std::vector<ui8> controlData(size);
 	auto ret = primaryFile->read(data, size);
-	controlFile->read(controlData.data(), size);
-	
-	if(!foundDesync && std::memcmp(data, controlData.data(), size))
+
+	if(!foundDesync)
 	{
-		tlog1 << "Desync found! Position: " << primaryFile->sfile->tellg() << std::endl;
-		foundDesync = true;
-		//throw std::runtime_error("Savegame dsynchronized!");
+		controlFile->read(controlData.data(), size);
+		if(std::memcmp(data, controlData.data(), size))
+		{
+			tlog1 << "Desync found! Position: " << primaryFile->sfile->tellg() << std::endl;
+			foundDesync = true;
+			//throw std::runtime_error("Savegame dsynchronized!");
+		}
 	}
-
 	return ret;
 }
 

+ 1 - 1
lib/GameConstants.h

@@ -14,7 +14,7 @@
 
 namespace GameConstants
 {
-	const std::string VCMI_VERSION = "VCMI 0.91b";
+	const std::string VCMI_VERSION = "VCMI 0.91c";
 
 	/*
 	 * DATA_DIR contains the game data (Data/, MP3/, ...).