completely remove EnginePaths::resolve

This commit is contained in:
MihailRis
2025-02-04 12:35:19 +03:00
parent b955ae59c1
commit a653b063e6
12 changed files with 67 additions and 106 deletions
@@ -14,7 +14,7 @@ using namespace scripting;
static int l_save_fragment(lua::State* L) {
const auto& paths = engine->getPaths();
auto fragment = lua::touserdata<lua::LuaVoxelFragment>(L, 1);
auto file = paths.resolve(lua::require_string(L, 2), true);
auto file = lua::require_string(L, 2);
auto map = fragment->getFragment()->serialize();
auto bytes = json::to_binary(map, true);
io::write_bytes(file, bytes.data(), bytes.size());
@@ -35,9 +35,7 @@ static int l_create_fragment(lua::State* L) {
}
static int l_load_fragment(lua::State* L) {
const auto& paths = engine->getPaths();
auto filename = lua::require_string(L, 1);
auto path = paths.resolve(filename);
io::path path = lua::require_string(L, 1);
if (!io::exists(path)) {
throw std::runtime_error("file "+path.string()+" does not exist");
}