| 419 | } |
| 420 | |
| 421 | sol::function LuaState::loadFromVFS(const VFS::Path::Normalized& path) |
| 422 | { |
| 423 | std::string fileContent(std::istreambuf_iterator<char>(*mVFS->get(path)), {}); |
| 424 | sol::load_result res = mSol.load(fileContent, path.value(), sol::load_mode::text); |
| 425 | if (!res.valid()) |
| 426 | throw std::runtime_error(std::string("Lua error: ") += res.get<sol::error>().what()); |
| 427 | return res; |
| 428 | } |
| 429 | |
| 430 | sol::function LuaState::loadInternalLib(std::string_view libName) |
| 431 | { |