(svn r16649) -Fix: When the exact AI version a game was saved with is no longer available and the latest version of the AI can't load data from that AI version, use the latest available version of the AI that can load the data instead of the first found version that can load the data.

pull/155/head
yexo 15 years ago
parent a52f5c45e6
commit f225163e60

@ -310,7 +310,7 @@ AIInfo *AIScanner::FindInfo(const char *nameParam, int versionParam)
snprintf(ai_name_compare, sizeof(ai_name_compare), "%s", (*it).second->GetName());
strtolower(ai_name_compare);
if (strcasecmp(ai_name, ai_name_compare) == 0 && (*it).second->CanLoadFromVersion(versionParam)) {
if (strcasecmp(ai_name, ai_name_compare) == 0 && (*it).second->CanLoadFromVersion(versionParam) && version == -1 || (*it).second->GetVersion() > version) {
version = (*it).second->GetVersion();
info = (*it).second;
}

Loading…
Cancel
Save