Improve Buffer:setVertex error message;

This commit is contained in:
bjorn 2016-11-14 20:21:10 -08:00
parent ee08af588c
commit 0c86495171
1 changed files with 4 additions and 0 deletions

View File

@ -127,6 +127,10 @@ int l_lovrBufferSetVertex(lua_State* L) {
BufferFormat format = lovrBufferGetVertexFormat(buffer);
void* vertex = lovrBufferGetScratchVertex(buffer);
if (index < 0 || index >= buffer->size) {
return luaL_error(L, "Invalid buffer vertex index: %d", index + 1);
}
if (lua_istable(L, 3)) {
int tableCount = lua_objlen(L, 3);
int tableIndex = 1;