summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-11-18 22:27:15 +0000
committerrubidium <rubidium@openttd.org>2010-11-18 22:27:15 +0000
commited04bef953da730829770e98fc3a91649eeee23e (patch)
tree45451a9d1d0685e10c5ea6f0043f331489893416
parentf7b2a87292fdfec4bc695e4d962f9c6e17a14800 (diff)
downloadopenttd-ed04bef953da730829770e98fc3a91649eeee23e.tar.xz
(svn r21248) -Codechange: don't run the tar scanner twice upon startup
-rw-r--r--src/ai/ai_scanner.cpp1
-rw-r--r--src/console_cmds.cpp2
-rw-r--r--src/network/network_content_gui.cpp2
-rw-r--r--src/newgrf_gui.cpp2
-rw-r--r--src/openttd.cpp2
5 files changed, 8 insertions, 1 deletions
diff --git a/src/ai/ai_scanner.cpp b/src/ai/ai_scanner.cpp
index e6c2e87e7..6971a6956 100644
--- a/src/ai/ai_scanner.cpp
+++ b/src/ai/ai_scanner.cpp
@@ -22,7 +22,6 @@
void AIScanner::RescanAIDir()
{
- TarScanner::DoScan();
this->ScanScriptDir("info.nut", AI_DIR);
this->ScanScriptDir("library.nut", AI_LIBRARY_DIR);
}
diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp
index f29e315e0..56cc88edf 100644
--- a/src/console_cmds.cpp
+++ b/src/console_cmds.cpp
@@ -1157,6 +1157,7 @@ DEF_CONSOLE_CMD(ConRescanAI)
return true;
}
+ TarScanner::DoScan();
AI::Rescan();
InvalidateWindowData(WC_AI_LIST, 0, 1);
@@ -1171,6 +1172,7 @@ DEF_CONSOLE_CMD(ConRescanNewGRF)
return true;
}
+ TarScanner::DoScan();
ScanNewGRFFiles();
InvalidateWindowData(WC_GAME_OPTIONS, 0, 1);
diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp
index b48781ea0..8e5214ebc 100644
--- a/src/network/network_content_gui.cpp
+++ b/src/network/network_content_gui.cpp
@@ -87,6 +87,8 @@ public:
/** Free whatever we've allocated */
~NetworkContentDownloadStatusWindow()
{
+ TarScanner::DoScan();
+
/* Tell all the backends about what we've downloaded */
for (ContentType *iter = this->receivedTypes.Begin(); iter != this->receivedTypes.End(); iter++) {
switch (*iter) {
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp
index 6836b13e7..864b2a600 100644
--- a/src/newgrf_gui.cpp
+++ b/src/newgrf_gui.cpp
@@ -24,6 +24,7 @@
#include "querystring_gui.h"
#include "core/geometry_func.hpp"
#include "newgrf_text.h"
+#include "fileio_func.h"
#include "table/strings.h"
#include "table/sprites.h"
@@ -977,6 +978,7 @@ struct NewGRFWindow : public QueryStringBaseWindow {
case SNGRFS_RESCAN_FILES:
case SNGRFS_RESCAN_FILES2:
+ TarScanner::DoScan();
ScanNewGRFFiles();
this->avail_sel = NULL;
this->avail_pos = -1;
diff --git a/src/openttd.cpp b/src/openttd.cpp
index e324eeba1..95309b23c 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -202,6 +202,7 @@ static void ShowHelp()
p = BlitterFactoryBase::GetBlittersInfo(p, lastof(buf));
/* We need to initialize the AI, so it finds the AIs */
+ TarScanner::DoScan();
AI::Initialize();
p = AI::GetConsoleList(p, lastof(buf));
AI::Uninitialize(true);
@@ -572,6 +573,7 @@ int ttd_main(int argc, char *argv[])
if (_dedicated_forks) DedicatedFork();
#endif
+ TarScanner::DoScan();
AI::Initialize();
LoadFromConfig();
AI::Uninitialize(true);