summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/saveload/ai_sl.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/saveload/ai_sl.cpp b/src/saveload/ai_sl.cpp
index d5687db54..594493f75 100644
--- a/src/saveload/ai_sl.cpp
+++ b/src/saveload/ai_sl.cpp
@@ -70,12 +70,20 @@ static void Load_AIPL()
} else {
config->ChangeAI(_ai_saveload_name, _ai_saveload_version);
if (!config->HasAI()) {
- if (strcmp(_ai_saveload_name, "%_dummy") != 0) {
- DEBUG(ai, 0, "The savegame has an AI by the name '%s', version %d which is no longer available.", _ai_saveload_name, _ai_saveload_version);
- DEBUG(ai, 0, "A random other AI will be loaded in its place.");
+ /* No version of the AI available that can load the data. Try to load the
+ * latest version of the AI instead. */
+ config->ChangeAI(_ai_saveload_name, -1);
+ if (!config->HasAI()) {
+ if (strcmp(_ai_saveload_name, "%_dummy") != 0) {
+ DEBUG(ai, 0, "The savegame has an AI by the name '%s', version %d which is no longer available.", _ai_saveload_name, _ai_saveload_version);
+ DEBUG(ai, 0, "A random other AI will be loaded in its place.");
+ } else {
+ DEBUG(ai, 0, "The savegame had no AIs available at the time of saving.");
+ DEBUG(ai, 0, "A random available AI will be loaded now.");
+ }
} else {
- DEBUG(ai, 0, "The savegame had no AIs available at the time of saving.");
- DEBUG(ai, 0, "A random available AI will be loaded now.");
+ DEBUG(ai, 0, "The savegame has an AI by the name '%s', version %d which is no longer available.", _ai_saveload_name, _ai_saveload_version);
+ DEBUG(ai, 0, "The latest version of that AI has been loaded instead, but it'll not get the savegame data as it's incompatible.");
}
/* Make sure the AI doesn't get the saveload data, as he was not the
* writer of the saveload data in the first place */