summaryrefslogtreecommitdiff
path: root/src/ai
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-08-25 10:37:28 +0000
committerrubidium <rubidium@openttd.org>2011-08-25 10:37:28 +0000
commitd839aa04755094827f1aa978707daeb25f8f02dc (patch)
tree2d4f2dc54877783bff08e822c451a7ca1240ff55 /src/ai
parent672df52e0c2e2192f7b63acfdbcd6e4f0fa457bf (diff)
downloadopenttd-d839aa04755094827f1aa978707daeb25f8f02dc.tar.xz
(svn r22836) -Codechange: simplify the scanning of (AI) scripts
Diffstat (limited to 'src/ai')
-rw-r--r--src/ai/ai_scanner.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ai/ai_scanner.cpp b/src/ai/ai_scanner.cpp
index 424746c07..aa4e5190a 100644
--- a/src/ai/ai_scanner.cpp
+++ b/src/ai/ai_scanner.cpp
@@ -24,8 +24,8 @@ void AIScanner::RescanAIDir()
{
/* Get rid of information of old AIs. */
this->Reset();
- this->ScanScriptDir("info.nut", AI_DIR);
- this->ScanScriptDir("library.nut", AI_LIBRARY_DIR);
+ this->Scan(PATHSEP "info.nut", AI_DIR);
+ this->Scan(PATHSEP "library.nut", AI_LIBRARY_DIR);
}
AIScanner::AIScanner() :
@@ -56,7 +56,9 @@ AIScanner::AIScanner() :
/* Create the dummy AI */
this->engine->ResetCrashed();
- strecpy(this->main_script, "%_dummy", lastof(this->main_script));
+
+ free(this->main_script);
+ this->main_script = strdup("%_dummy");
extern void AI_CreateAIInfoDummy(HSQUIRRELVM vm);
AI_CreateAIInfoDummy(this->engine->GetVM());
}