diff options
author | rubidium <rubidium@openttd.org> | 2011-11-14 21:40:39 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2011-11-14 21:40:39 +0000 |
commit | 4ae8bbea0706aa6c878d713489056ef634aa2d6d (patch) | |
tree | 366dec593752264fe905cd51d2478d88caaba56e /src/ai | |
parent | 387e410f3e7898cadec041f2849bc949810544bb (diff) | |
download | openttd-4ae8bbea0706aa6c878d713489056ef634aa2d6d.tar.xz |
(svn r23222) -Codechange: reduce tar scanning calls to the bare minimum
Diffstat (limited to 'src/ai')
-rw-r--r-- | src/ai/ai_core.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ai/ai_core.cpp b/src/ai/ai_core.cpp index 18eeef3b0..0e7667ba4 100644 --- a/src/ai/ai_core.cpp +++ b/src/ai/ai_core.cpp @@ -17,6 +17,7 @@ #include "../network/network.h" #include "../window_func.h" #include "../command_func.h" +#include "../fileio_func.h" #include "ai_scanner.hpp" #include "ai_instance.hpp" #include "ai_config.hpp" @@ -136,7 +137,10 @@ if (AI::ai_scanner != NULL) AI::Uninitialize(true); AI::frame_counter = 0; - if (AI::ai_scanner == NULL) AI::ai_scanner = new AIScanner(); + if (AI::ai_scanner == NULL) { + TarScanner::DoScan(TarScanner::AI); + AI::ai_scanner = new AIScanner(); + } } /* static */ void AI::Uninitialize(bool keepConfig) @@ -325,6 +329,8 @@ void CcAI(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) /* static */ void AI::Rescan() { + TarScanner::DoScan(TarScanner::AI); + AI::ai_scanner->RescanAIDir(); ResetConfig(); |