Index: src/ai/ai_scanner.cpp
===================================================================
--- src/ai/ai_scanner.cpp (revision 27582)
+++ src/ai/ai_scanner.cpp (working copy)
@@ -136,6 +136,20 @@
}
}
+ /* If we didn't find a match AI, maybe the savegame included a version */
+ if (info == NULL && !force_exact_match && versionParam != -1) {
+ char *e = strrchr(ai_name, '.');
+ if (e == NULL) return NULL;
+ *e = '\0';
+ e++;
+ versionParam = atoi(e);
+ /* Try to find a direct 'name.version' match */
+ char ai_name_tmp[1024];
+ seprintf(ai_name_tmp, lastof(ai_name_tmp), "%s.%d", ai_name, versionParam);
+ strtolower(ai_name_tmp);
+ if (this->info_list.find(ai_name_tmp) != this->info_list.end()) return static_cast<AIInfo *>(this->info_list[ai_name_tmp]);
+ }
+
return info;
}
Index: src/game/game_scanner.cpp
===================================================================
--- src/game/game_scanner.cpp (revision 27582)
+++ src/game/game_scanner.cpp (working copy)
@@ -77,6 +77,20 @@
}
}
+ /* If we didn't find a match Game script, maybe the savegame included a version */
+ if (info == NULL && !force_exact_match && versionParam != -1) {
+ char *e = strrchr(game_name, '.');
+ if (e == NULL) return NULL;
+ *e = '\0';
+ e++;
+ versionParam = atoi(e);
+ /* Try to find a direct 'name.version' match */
+ char game_name_tmp[1024];
+ seprintf(game_name_tmp, lastof(game_name_tmp), "%s.%d", game_name, versionParam);
+ strtolower(game_name_tmp);
+ if (this->info_list.find(game_name_tmp) != this->info_list.end()) return static_cast<GameInfo *>(this->info_list[game_name_tmp]);
+ }
+
return info;
}