summaryrefslogtreecommitdiff
path: root/src/ai/ai_scanner.cpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2009-02-23 20:57:55 +0000
committeryexo <yexo@openttd.org>2009-02-23 20:57:55 +0000
commit1884ba20bc1b6b02a256e444af04f96e7bc22778 (patch)
treeedcd3128ab0f8361e003f55d4b117e1435475f2d /src/ai/ai_scanner.cpp
parentc876e3e1b29dd5c89454a14e8ef8ea6c17929d1a (diff)
downloadopenttd-1884ba20bc1b6b02a256e444af04f96e7bc22778.tar.xz
(svn r15562) -Change: Use GetName() to determine the unique AI name instead of GetInstanceName() to make branching of AIs easier.
Diffstat (limited to 'src/ai/ai_scanner.cpp')
-rw-r--r--src/ai/ai_scanner.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ai/ai_scanner.cpp b/src/ai/ai_scanner.cpp
index 7e4e878d4..860a8d7cd 100644
--- a/src/ai/ai_scanner.cpp
+++ b/src/ai/ai_scanner.cpp
@@ -307,12 +307,12 @@ void AIScanner::RegisterLibrary(AILibrary *library)
void AIScanner::RegisterAI(AIInfo *info)
{
char ai_name[1024];
- snprintf(ai_name, sizeof(ai_name), "%s.%d", info->GetInstanceName(), info->GetVersion());
+ snprintf(ai_name, sizeof(ai_name), "%s.%d", info->GetName(), info->GetVersion());
strtolower(ai_name);
/* Check if GetShortName follows the rules */
if (strlen(info->GetShortName()) != 4) {
- DEBUG(ai, 0, "The AI '%s' returned a string from GetShortName() which is not four characaters. Unable to load the AI.", info->GetInstanceName());
+ DEBUG(ai, 0, "The AI '%s' returned a string from GetShortName() which is not four characaters. Unable to load the AI.", info->GetName());
delete info;
return;
}
@@ -342,7 +342,7 @@ void AIScanner::RegisterAI(AIInfo *info)
/* Add the AI to the 'unique' AI list, where only the highest version of the
* AI is registered. */
- snprintf(ai_name, sizeof(ai_name), "%s", info->GetInstanceName());
+ snprintf(ai_name, sizeof(ai_name), "%s", info->GetName());
strtolower(ai_name);
if (this->info_single_list.find(ai_name) == this->info_single_list.end()) {
this->info_single_list[strdup(ai_name)] = info;
@@ -406,7 +406,7 @@ AIInfo *AIScanner::FindInfo(const char *nameParam, int versionParam)
AIInfoList::iterator it = this->info_list.begin();
for (; it != this->info_list.end(); it++) {
char ai_name_compare[1024];
- snprintf(ai_name_compare, sizeof(ai_name_compare), "%s", (*it).second->GetInstanceName());
+ 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)) {
@@ -424,7 +424,7 @@ char *AIScanner::GetAIConsoleList(char *p, const char *last)
AIInfoList::iterator it = this->info_list.begin();
for (; it != this->info_list.end(); it++) {
AIInfo *i = (*it).second;
- p += seprintf(p, last, "%10s (v%d): %s\n", i->GetInstanceName(), i->GetVersion(), i->GetDescription());
+ p += seprintf(p, last, "%10s (v%d): %s\n", i->GetName(), i->GetVersion(), i->GetDescription());
}
p += seprintf(p, last, "\n");