| 178 | } |
| 179 | |
| 180 | static std::string filterSaveFileName(std::string s) { |
| 181 | for (auto &ch : s) { |
| 182 | if (!isalnum(ch) && ch != '-' && ch != '_') |
| 183 | ch = '_'; |
| 184 | } |
| 185 | return s; |
| 186 | } |
| 187 | |
| 188 | static std::filesystem::path getSavePath(const std::string &world) { |
| 189 | return Filesystem::getBaseDir() / "save" / world; |