summaryrefslogtreecommitdiff
path: root/src/script/script_scanner.cpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2012-08-20 21:01:40 +0000
committeryexo <yexo@openttd.org>2012-08-20 21:01:40 +0000
commitfe31aa28c422f1fab32ab3b72d8369d539c8496e (patch)
tree78d7776bd3eaf5c9fb62ca7f3b7ea4e26824260b /src/script/script_scanner.cpp
parent2a89d0d13d9b7afb6a56b31715ba1b022070eef8 (diff)
downloadopenttd-fe31aa28c422f1fab32ab3b72d8369d539c8496e.tar.xz
(svn r24487) -Codechange [FS#5236]: make several DoesContentExist return the path instead of a boolean (LordAro)
Diffstat (limited to 'src/script/script_scanner.cpp')
-rw-r--r--src/script/script_scanner.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/script/script_scanner.cpp b/src/script/script_scanner.cpp
index 552b1cf46..248b17f9a 100644
--- a/src/script/script_scanner.cpp
+++ b/src/script/script_scanner.cpp
@@ -271,4 +271,12 @@ bool ScriptScanner::HasScript(const ContentInfo *ci, bool md5sum)
return false;
}
+const char *ScriptScanner::FindMainScript(const ContentInfo *ci, bool md5sum)
+{
+ for (ScriptInfoList::iterator it = this->info_list.begin(); it != this->info_list.end(); it++) {
+ if (IsSameScript(ci, md5sum, (*it).second, this->GetDirectory())) return (*it).second->GetMainScript();
+ }
+ return NULL;
+}
+
#endif /* ENABLE_NETWORK */