Skip to content

Commit 35ec35c

Browse files
committed
Fix some zero-based indices returned from ModelData methods;
1 parent 7722dba commit 35ec35c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/api/l_data_modelData.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ int l_lovrModelMetaGetAnimationNode(lua_State* L) {
654654
uint32_t index = luax_checku32(L, 3) - 1;
655655
luax_check(L, index < animation->channelCount, "Invalid channel index '%d'", index + 1);
656656
ModelAnimationChannel* channel = &animation->channels[index];
657-
lua_pushinteger(L, channel->nodeIndex);
657+
lua_pushinteger(L, channel->nodeIndex + 1);
658658
return 1;
659659
}
660660

@@ -723,7 +723,7 @@ int l_lovrModelMetaGetSkinJoints(lua_State* L) {
723723
ModelSkin* skin = &meta->skins[index];
724724
lua_createtable(L, skin->jointCount, 0);
725725
for (uint32_t i = 0; i < skin->jointCount; i++) {
726-
lua_pushinteger(L, skin->joints[i]);
726+
lua_pushinteger(L, skin->joints[i] + 1);
727727
lua_rawseti(L, -2, i + 1);
728728
}
729729
return 1;

0 commit comments

Comments
 (0)