From ab9f88e4c7adc011f4bfb2ba5c24199c0b52a735 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Sun, 20 Mar 2011 06:23:19 +0000 Subject: [PATCH] - bugfix for map CRC checking after downloading a map --- .../glest_game/menu/menu_state_connected_game.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/source/glest_game/menu/menu_state_connected_game.cpp b/source/glest_game/menu/menu_state_connected_game.cpp index 15ce3383d..b2c289193 100644 --- a/source/glest_game/menu/menu_state_connected_game.cpp +++ b/source/glest_game/menu/menu_state_connected_game.cpp @@ -2114,15 +2114,20 @@ void MenuStateConnectedGame::FTPClient_CallbackEvent(string itemName, FTP_Client fileFTPProgressList.erase(itemName); safeMutexFTPProgress.ReleaseLock(); - // Clear the CRC file Cache - Checksum::clearFileCache(); - lastCheckedCRCMapValue = -1; - NetworkManager &networkManager= NetworkManager::getInstance(); ClientInterface* clientInterface= networkManager.getClientInterface(); const GameSettings *gameSettings = clientInterface->getGameSettings(); if(result == ftp_crt_SUCCESS) { + // Clear the CRC file Cache + Checksum::clearFileCache(); + //lastCheckedCRCMapValue = -1; + Checksum checksum; + string file = Map::getMapPath(gameSettings->getMap(),"",false); + //console.addLine("Checking map CRC [" + file + "]"); + checksum.addFile(file); + lastCheckedCRCMapValue = checksum.getSum(); + char szMsg[1024]=""; if(lang.hasString("DataMissingMapSuccessDownload") == true) { sprintf(szMsg,lang.get("DataMissingMapSuccessDownload").c_str(),getHumanPlayerName().c_str(),gameSettings->getMap().c_str());