(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.

replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
yexo 15 years ago
parent 8bc9adde19
commit 2970b72e59

@ -310,7 +310,7 @@ AIInfo *AIScanner::FindInfo(const char *nameParam, int versionParam)
snprintf(ai_name_compare, sizeof(ai_name_compare), "%s", (*it).second->GetName()); snprintf(ai_name_compare, sizeof(ai_name_compare), "%s", (*it).second->GetName());
strtolower(ai_name_compare); 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(); version = (*it).second->GetVersion();
info = (*it).second; info = (*it).second;
} }

Loading…
Cancel
Save