Improve error message when Mesh:setVertexMap is used with an empty array.

This commit is contained in:
Sasha Szpakowski
2023-09-30 17:54:09 -03:00
parent 2fd2930c24
commit 691d910c3e
+3
View File
@@ -320,6 +320,9 @@ static void copyToIndexBuffer(const std::vector<uint32> &indices, void *data, si
void Mesh::setVertexMap(const std::vector<uint32> &map)
{
if (map.empty())
throw love::Exception("Vertex map array must not be empty.");
size_t maxval = getVertexCount();
IndexDataType datatype = getIndexDataTypeFromMax(maxval);