mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 04:51:49 +00:00
add Bytearray support to lua::tovalue
This commit is contained in:
parent
d2bbd82dbe
commit
eaff5643a3
1 changed files with 7 additions and 0 deletions
|
|
@ -133,6 +133,13 @@ dv::value lua::tovalue(State* L, int idx) {
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
case LUA_TUSERDATA: {
|
||||||
|
if (auto bytes = touserdata<LuaBytearray>(L, idx)) {
|
||||||
|
const auto& data = bytes->data();
|
||||||
|
return std::make_shared<dv::objects::Bytes>(data.data(), data.size());
|
||||||
|
}
|
||||||
|
[[fallthrough]];
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
throw std::runtime_error(
|
throw std::runtime_error(
|
||||||
"lua type " + std::string(lua_typename(L, type)) +
|
"lua type " + std::string(lua_typename(L, type)) +
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue