fix rig:set_matrix for nil index

This commit is contained in:
MihailRis 2026-09-03 20:28:08 +03:00
parent da925021cb
commit 4370eedc0a

View file

@ -77,6 +77,9 @@ static int l_get_matrix(lua::State* L) {
static int l_set_matrix(lua::State* L) {
if (auto skeleton = get_skeleton(L)) {
if (lua::isnoneornil(L, 2)) {
return 0;
}
auto index = index_range_check(*skeleton, lua::tointeger(L, 2));
skeleton->pose.matrices[index] = lua::tomat4(L, 3);
}