mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Remove 'mesetint' gameid rewriting kludge
This commit is contained in:
parent
88c7a54e08
commit
d60189915c
1 changed files with 5 additions and 6 deletions
|
@ -16,6 +16,9 @@
|
||||||
// The maximum number of identical world names allowed
|
// The maximum number of identical world names allowed
|
||||||
#define MAX_WORLD_NAMES 100
|
#define MAX_WORLD_NAMES 100
|
||||||
|
|
||||||
|
// gameid to assume for worlds that are missing world.mt
|
||||||
|
#define LEGACY_GAMEID "minetest"
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -231,10 +234,9 @@ std::vector<SubgameSpec> getAvailableGames()
|
||||||
return specs;
|
return specs;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define LEGACY_GAMEID "minetest"
|
|
||||||
|
|
||||||
bool getWorldExists(const std::string &world_path)
|
bool getWorldExists(const std::string &world_path)
|
||||||
{
|
{
|
||||||
|
// Note: very old worlds are valid without a world.mt
|
||||||
return (fs::PathExists(world_path + DIR_DELIM + "map_meta.txt") ||
|
return (fs::PathExists(world_path + DIR_DELIM + "map_meta.txt") ||
|
||||||
fs::PathExists(world_path + DIR_DELIM + "world.mt"));
|
fs::PathExists(world_path + DIR_DELIM + "world.mt"));
|
||||||
}
|
}
|
||||||
|
@ -261,7 +263,7 @@ std::string getWorldGameId(const std::string &world_path, bool can_be_legacy)
|
||||||
bool succeeded = conf.readConfigFile(conf_path.c_str());
|
bool succeeded = conf.readConfigFile(conf_path.c_str());
|
||||||
if (!succeeded) {
|
if (!succeeded) {
|
||||||
if (can_be_legacy) {
|
if (can_be_legacy) {
|
||||||
// If map_meta.txt exists, it is probably an old minetest world
|
// If map_meta.txt exists, it is probably a very old world
|
||||||
if (fs::PathExists(world_path + DIR_DELIM + "map_meta.txt"))
|
if (fs::PathExists(world_path + DIR_DELIM + "map_meta.txt"))
|
||||||
return LEGACY_GAMEID;
|
return LEGACY_GAMEID;
|
||||||
}
|
}
|
||||||
|
@ -269,9 +271,6 @@ std::string getWorldGameId(const std::string &world_path, bool can_be_legacy)
|
||||||
}
|
}
|
||||||
if (!conf.exists("gameid"))
|
if (!conf.exists("gameid"))
|
||||||
return "";
|
return "";
|
||||||
// The "mesetint" gameid has been discarded
|
|
||||||
if (conf.get("gameid") == "mesetint")
|
|
||||||
return "minetest";
|
|
||||||
return conf.get("gameid");
|
return conf.get("gameid");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue