mirror of https://github.com/bjornbytes/lovr.git
Fix crash when drawing zero lines;
This commit is contained in:
parent
7ef215c312
commit
0365f51f9d
|
@ -921,6 +921,7 @@ static int l_lovrGraphicsPoints(lua_State* L) {
|
|||
static int l_lovrGraphicsLine(lua_State* L) {
|
||||
float* vertices;
|
||||
uint32_t count = luax_getvertexcount(L, 1);
|
||||
lovrAssert(count >= 2, "Need at least 2 points to draw a line");
|
||||
lovrGraphicsLine(count, &vertices);
|
||||
luax_readvertices(L, 1, vertices, count);
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue