- std::string worldmt_path = path + DIR_DELIM + "world.mt";
- if(!fs::PathExists(worldmt_path)){
- infostream<<"Creating world.mt ("<<worldmt_path<<")"<<std::endl;
+ std::string worldmt_path = path + DIR_DELIM "world.mt";
+ if (!fs::PathExists(worldmt_path)) {
+ std::ostringstream ss(std::ios_base::binary);
+ ss << "gameid = " << gamespec.id
+ << "\nbackend = sqlite3"
+ << "\ncreative_mode = " << g_settings->get("creative_mode")
+ << "\nenable_damage = " << g_settings->get("enable_damage")
+ << "\n";
+ if (!fs::safeWriteToFile(worldmt_path, ss.str()))
+ return false;
+
+ infostream << "Wrote world.mt (" << worldmt_path << ")" << std::endl;
+ }
+
+ // Create map_meta.txt if does not already exist
+ std::string map_meta_path = path + DIR_DELIM + "map_meta.txt";
+ if (!fs::PathExists(map_meta_path)){
+ verbosestream << "Creating map_meta.txt (" << map_meta_path << ")" << std::endl;