mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
add EnginePaths::parsePath & update generation.load_structure
This commit is contained in:
parent
4f882a3ca3
commit
aa1fb26ea5
4 changed files with 18 additions and 7 deletions
|
|
@ -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");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue