Skip to content

Commit b10daf2

Browse files
vincelewench
authored andcommitted
Fix compilation when DEBUG_PATHS is defined
Error message: modmgr.cc: In constructor 'ModManager::ModManager(const std::string&, const std::string&, bool, bool)': modmgr.cc:544:86: error: 'src_dir' was not declared in this scope 544 | cout << "setting " << cfgname << " source directory to: " << src_dir | ^~~~~~~ Fixing by harmonizing the `src_dir` handling like the other ones. Signed-off-by: Vincent Legoll <[email protected]>
1 parent 2f8b6cb commit b10daf2

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

gamemgr/modmgr.cc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,7 @@ ModManager::ModManager(
512512
{
513513
string patch_dir;
514514
string mods_dir;
515+
string src_dir;
515516
string default_dir;
516517
string config_path;
517518

@@ -529,8 +530,10 @@ ModManager::ModManager(
529530

530531
// <source> setting: default is "$game_path/source".
531532
config_path = base_cfg_path + "/source";
532-
config->value(config_path.c_str(), patch_dir, default_dir.c_str());
533-
add_system_path("<" + path_prefix + "_SOURCE>", "");
533+
default_dir = game_path + "/source";
534+
config->value(config_path.c_str(), src_dir, default_dir.c_str());
535+
add_system_path("<" + path_prefix + "_SOURCE>", src_dir);
536+
534537
#ifdef DEBUG_PATHS
535538
if (!silent) {
536539
cout << "path prefix of " << cfgname << " is: " << path_prefix
@@ -541,8 +544,8 @@ ModManager::ModManager(
541544
<< " patch directory to: " << patch_dir << endl;
542545
cout << "setting " << cfgname
543546
<< " modifications directory to: " << mods_dir << endl;
544-
cout << "setting " << cfgname << " source directory to: " << src_dir
545-
<< endl;
547+
cout << "setting " << cfgname
548+
<< " source directory to: " << src_dir << endl;
546549
}
547550
#endif
548551
}

0 commit comments

Comments
 (0)