MCPcopy Create free account
hub / github.com/crawl/crawl / reset_paths

Method reset_paths

crawl-ref/source/initfile.cc:1527–1562  ·  view source on GitHub ↗

* Reset options paths based on SysEnv values. Should be called if these get * changed, but will override several options values. */

Source from the content-addressed store, hash-verified

1525 * changed, but will override several options values.
1526 */
1527void game_options::reset_paths()
1528{
1529 macro_dir = SysEnv.macro_dir;
1530
1531 save_dir = _get_save_path("saves/");
1532 morgue_dir = _get_save_path("morgue/");
1533
1534
1535#ifndef DGAMELAUNCH
1536 save_dir_option = "";
1537 if (macro_dir.empty())
1538 {
1539 macro_dir_option = ""; // maybe unnecessary?
1540#ifdef UNIX
1541 macro_dir = _user_home_subpath(".crawl");
1542#else
1543 macro_dir = "settings/";
1544#endif
1545 }
1546#endif
1547
1548#if defined(TARGET_OS_MACOSX)
1549 if (SysEnv.macro_dir.empty())
1550 {
1551 macro_dir_option = "";
1552 macro_dir = _get_save_path("");
1553 }
1554#endif
1555
1556#if defined(SHARED_DIR_PATH)
1557 shared_dir = _resolve_dir(SHARED_DIR_PATH, "");
1558#else
1559 shared_dir = save_dir;
1560#endif
1561
1562}
1563
1564void game_options::reset_options()
1565{

Callers 2

_print_save_versionFunction · 0.80
print_save_jsonFunction · 0.80

Calls 4

_get_save_pathFunction · 0.85
_user_home_subpathFunction · 0.85
_resolve_dirFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected