add EnginePaths::parsePath & update generation.load_structure

This commit is contained in:
MihailRis
2024-09-21 01:24:38 +03:00
parent 4f882a3ca3
commit aa1fb26ea5
4 changed files with 18 additions and 7 deletions
+3 -2
View File
@@ -29,8 +29,9 @@ static int l_save_structure(lua::State* L) {
static int l_load_structure(lua::State* L) {
auto paths = engine->getPaths();
auto filename = lua::require_string(L, 1);
auto path = paths->resolve(filename);
auto [prefix, filename] = EnginePaths::parsePath(lua::require_string(L, 1));
auto path = paths->resolve(prefix+":generators/"+filename+".vox");
if (!std::filesystem::exists(path)) {
throw std::runtime_error("file "+path.u8string()+" does not exist");
}