2
0
mirror of https://github.com/rehlds/metamod-r.git synced 2025-01-13 23:28:23 +03:00

Merge pull request #28 from In-line/AddPluginsFile

Add mm_pluginsfile option
This commit is contained in:
theAsmodai 2018-02-08 18:00:30 +03:00 committed by GitHub
commit 2e23956a45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -186,6 +186,18 @@ void metamod_startup()
//
// In fact, we need gamedir even earlier, so moved up above.
const char *pf = LOCALINFO("mm_pluginsfile");
if (pf && *pf != '\0') {
META_LOG("Pluginfile specified via localinfo: %s", pf);
if (is_file_exists_in_gamedir(pf)) {
Q_strlcpy(pluginFile, pf);
}
else {
META_ERROR("Empty/missing plugins.ini file: %s; falling back to %s", pf, pluginFile);
}
}
// Load plugins file
if (!is_file_exists_in_gamedir(pluginFile)) {
Q_strlcpy(pluginFile, g_config->directory());