Fix handling of negative indices in SurfaceTool

(cherry picked from commit 735f75a16b)
This commit is contained in:
Delf Neumärker 2021-02-18 22:43:39 +01:00 committed by Rémi Verschelde
parent 13871deb57
commit fd90fc2c9b

View File

@ -266,6 +266,7 @@ void SurfaceTool::add_triangle_fan(const Vector<Vector3> &p_vertices, const Vect
void SurfaceTool::add_index(int p_index) {
ERR_FAIL_COND(!begun);
ERR_FAIL_COND(p_index < 0);
format |= Mesh::ARRAY_FORMAT_INDEX;
index_array.push_back(p_index);