forked from Mirrorlandia_minetest/minetest
Rename MINETEST_SUBGAME_PATH
to MINETEST_GAME_PATH
(#14351)
This commit is contained in:
parent
e2ccd14c05
commit
7901087466
@ -119,7 +119,7 @@ Display an interactive terminal over ncurses during execution.
|
|||||||
|
|
||||||
.SH ENVIRONMENT
|
.SH ENVIRONMENT
|
||||||
.TP
|
.TP
|
||||||
.B MINETEST_SUBGAME_PATH
|
.B MINETEST_GAME_PATH
|
||||||
Colon delimited list of directories to search for games.
|
Colon delimited list of directories to search for games.
|
||||||
.TP
|
.TP
|
||||||
.B MINETEST_MOD_PATH
|
.B MINETEST_MOD_PATH
|
||||||
|
@ -77,8 +77,21 @@ struct GameFindPath
|
|||||||
|
|
||||||
std::string getSubgamePathEnv()
|
std::string getSubgamePathEnv()
|
||||||
{
|
{
|
||||||
|
static bool has_warned = false;
|
||||||
char *subgame_path = getenv("MINETEST_SUBGAME_PATH");
|
char *subgame_path = getenv("MINETEST_SUBGAME_PATH");
|
||||||
return subgame_path ? std::string(subgame_path) : "";
|
if (subgame_path && !has_warned) {
|
||||||
|
warningstream << "MINETEST_SUBGAME_PATH is deprecated, use MINETEST_GAME_PATH instead."
|
||||||
|
<< std::endl;
|
||||||
|
has_warned = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
char *game_path = getenv("MINETEST_GAME_PATH");
|
||||||
|
|
||||||
|
if (game_path)
|
||||||
|
return std::string(game_path);
|
||||||
|
else if (subgame_path)
|
||||||
|
return std::string(subgame_path);
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
SubgameSpec findSubgame(const std::string &id)
|
SubgameSpec findSubgame(const std::string &id)
|
||||||
|
@ -82,7 +82,7 @@ void TestServerModManager::runTests(IGameDef *gamedef)
|
|||||||
TEST(testGetModNames);
|
TEST(testGetModNames);
|
||||||
TEST(testGetModMediaPathsWrongDir);
|
TEST(testGetModMediaPathsWrongDir);
|
||||||
TEST(testGetModMediaPaths);
|
TEST(testGetModMediaPaths);
|
||||||
// TODO: test MINETEST_SUBGAME_PATH
|
// TODO: test MINETEST_GAME_PATH
|
||||||
|
|
||||||
unsetenv("MINETEST_MOD_PATH");
|
unsetenv("MINETEST_MOD_PATH");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user