add EnginePaths::parsePath & update generation.load_structure
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user