mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Tweaked the log for loading global scripts
* it should be after the game scripts check.
This commit is contained in:
@@ -646,21 +646,20 @@ void InitGlobalScripts() {
|
||||
static void PrepareGlobalScriptsList() {
|
||||
globalScriptFilesList.clear();
|
||||
|
||||
char* name = "scripts\\gl*.int";
|
||||
char** filenames;
|
||||
int count = fo::func::db_get_file_list(name, &filenames);
|
||||
int count = fo::func::db_get_file_list("scripts\\gl*.int", &filenames);
|
||||
|
||||
for (int i = 0; i < count; i++) {
|
||||
name = _strlwr(filenames[i]); // name of the script in lower case
|
||||
char* name = _strlwr(filenames[i]); // name of the script in lower case
|
||||
if (name[0] != 'g' || name[1] != 'l') continue; // fix bug in db_get_file_list fuction (if the script name begins with a non-Latin character)
|
||||
|
||||
std::string baseName(name);
|
||||
int lastDot = baseName.find_last_of('.');
|
||||
if ((baseName.length() - lastDot) > 4) continue; // skip files with invalid extension (bug in db_get_file_list fuction)
|
||||
dlog_f("Found global script: %s\n", DL_SCRIPT, name);
|
||||
|
||||
baseName = baseName.substr(0, lastDot); // script name without extension
|
||||
if (!IsGameScript(baseName.c_str())) {
|
||||
dlog_f("Found global script: %s\n", DL_SCRIPT, name);
|
||||
globalScriptFilesList.push_back(std::move(baseName));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user