mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-16 00:12:51 +00:00
(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.
This commit is contained in:
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…
Reference in New Issue
Block a user