mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Save creative_mode and enable_damage setting for each world in world.mt
Create Parameters on world initialisation and set settings of old worlds
This commit is contained in:
parent
2f0107f4a7
commit
8ca08a850f
5 changed files with 115 additions and 5 deletions
|
@ -283,7 +283,9 @@ bool initializeWorld(const std::string &path, const std::string &gameid)
|
|||
std::string worldmt_path = path + DIR_DELIM "world.mt";
|
||||
if (!fs::PathExists(worldmt_path)) {
|
||||
std::ostringstream ss(std::ios_base::binary);
|
||||
ss << "gameid = " << gameid << "\nbackend = sqlite3\n";
|
||||
ss << "gameid = " << gameid << "\nbackend = sqlite3\n"
|
||||
<< "creative_mode = " << g_settings->get("creative_mode")
|
||||
<< "\nenable_damage = " << g_settings->get("enable_damage") << "\n";
|
||||
if (!fs::safeWriteToFile(worldmt_path, ss.str()))
|
||||
return false;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue