diff --git a/core-legacy/sourcemm.cpp b/core-legacy/sourcemm.cpp index f208792..8f8b5f8 100644 --- a/core-legacy/sourcemm.cpp +++ b/core-legacy/sourcemm.cpp @@ -421,7 +421,7 @@ bool LoadFromVDF(const char *file, bool &skipped) int LoadVDFPluginsFromDir(const char *dir, int &skipped) { - bool success, skip; + bool success, skip; int total = 0; char path[MAX_PATH]; @@ -453,10 +453,10 @@ int LoadVDFPluginsFromDir(const char *dir, int &skipped) do { g_SmmAPI.PathFormat(path, sizeof(path), "%s\\%s", dir, fd.cFileName); - success = LoadFromVDF(path, skip); - if (skip) - skipped++; - else if (success) + success = LoadFromVDF(path, skip); + if (skip) + skipped++; + else if (success) total++; } while (FindNextFile(hFind, &fd)); @@ -485,10 +485,10 @@ int LoadVDFPluginsFromDir(const char *dir, int &skipped) continue; } g_SmmAPI.PathFormat(path, sizeof(path), "%s/%s", dir, pEnt->d_name); - success = LoadFromVDF(path, skip); - if (skip) - skipped++; - else if (success) + success = LoadFromVDF(path, skip); + if (skip) + skipped++; + else if (success) total++; } @@ -669,24 +669,24 @@ int LoadPluginsFromFile(const char *filepath, int &skipped) return total; } -int LoadPlugins(const char *filepath, const char *vdfpath) -{ - int total, skipped, fskipped, vskipped; - const char *s = ""; - - total = LoadPluginsFromFile(filepath, fskipped); - total += LoadVDFPluginsFromDir(vdfpath, vskipped); - skipped = fskipped + vskipped; - - if (total == 0 || total > 1) - s = "s"; - - if (skipped) - LogMessage("[META] Loaded %d plugin%s (%d already loaded)", total, s, skipped); - else - LogMessage("[META] Loaded %d plugin%s.", total, s); - - return total; +int LoadPlugins(const char *filepath, const char *vdfpath) +{ + int total, skipped, fskipped, vskipped; + const char *s = ""; + + total = LoadPluginsFromFile(filepath, fskipped); + total += LoadVDFPluginsFromDir(vdfpath, vskipped); + skipped = fskipped + vskipped; + + if (total == 0 || total > 1) + s = "s"; + + if (skipped) + LogMessage("[META] Loaded %d plugin%s (%d already loaded)", total, s, skipped); + else + LogMessage("[META] Loaded %d plugin%s.", total, s); + + return total; } void LogMessage(const char *msg, ...)