From 4a292ed1d135bc5fb5d46680b28d4c6aa00117c2 Mon Sep 17 00:00:00 2001 From: titiger Date: Thu, 1 Jan 2015 17:16:24 +0100 Subject: [PATCH] don't mix functionality Not a bug fix, just trying to keep things more clean. --- source/glest_game/menu/menu_state_root.cpp | 7 ++++++- source/shared_lib/include/util/util.h | 2 +- source/shared_lib/sources/util/util.cpp | 7 +------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/glest_game/menu/menu_state_root.cpp b/source/glest_game/menu/menu_state_root.cpp index edfd7b6c..5fc5c139 100644 --- a/source/glest_game/menu/menu_state_root.cpp +++ b/source/glest_game/menu/menu_state_root.cpp @@ -656,7 +656,12 @@ void MenuStateRoot::simpleTask(BaseThread *callingThread,void *userdata) { Properties props; props.loadFromText(updateMetaData); - int compareResult = compareMajorMinorVersion(glestVersionString, props.getString("LatestGameVersion",""),true); + int compareResult = compareMajorMinorVersion(glestVersionString, props.getString("LatestGameVersion","")); + if(compareResult==0) { + if(glestVersionString != props.getString("LatestGameVersion","")) { + compareResult = -1; + } + } if(SystemFlags::VERBOSE_MODE_ENABLED) printf("compareResult = %d local [%s] remote [%s]\n",compareResult,glestVersionString.c_str(),props.getString("LatestGameVersion","").c_str()); if(compareResult < 0) { diff --git a/source/shared_lib/include/util/util.h b/source/shared_lib/include/util/util.h index b77a328f..5e3c0c7c 100644 --- a/source/shared_lib/include/util/util.h +++ b/source/shared_lib/include/util/util.h @@ -239,7 +239,7 @@ float saturate(float value); int round(float f); //misc -int compareMajorMinorVersion(string versionA,string versionB, bool checkForNewVersionUpdates=false); +int compareMajorMinorVersion(string versionA,string versionB); int getMajor(string version); int getMinor(string version); bool checkVersionComptability(string clientVersionString, string serverVersionString); diff --git a/source/shared_lib/sources/util/util.cpp b/source/shared_lib/sources/util/util.cpp index 0d8cdd51..811638f6 100644 --- a/source/shared_lib/sources/util/util.cpp +++ b/source/shared_lib/sources/util/util.cpp @@ -787,7 +787,7 @@ int round(float f){ } // ==================== misc ==================== -int compareMajorMinorVersion(string versionA,string versionB, bool checkForNewVersionUpdates) { +int compareMajorMinorVersion(string versionA,string versionB) { int majorA = getMajor(versionA); int minorA = getMinor(versionA); int majorB = getMajor(versionB); @@ -801,11 +801,6 @@ int compareMajorMinorVersion(string versionA,string versionB, bool checkForNewVe return -1; } else if(minorA == minorB) { - if(checkForNewVersionUpdates) { - if(versionA != versionB) { - return -1; - } - } return 0; } else {