fix crash on 0 instance

main
cosmonaut 2020-12-14 00:52:40 -08:00
parent 808d50ccc2
commit f5cdd0b566
1 changed files with 9 additions and 6 deletions

View File

@ -44,12 +44,15 @@ namespace Kav
public void SetData()
{
VertexBuffer.SetData(
InstanceDataArray,
0,
InstanceCount,
SetDataOptions.NoOverwrite
);
if (InstanceCount > 0)
{
VertexBuffer.SetData(
InstanceDataArray,
0,
InstanceCount,
SetDataOptions.NoOverwrite
);
}
}
public void Clear()