Avoid crash if the argument is invalid (though it's not really a public function)

This commit is contained in:
Marc Gilleron 2021-10-04 20:15:32 +01:00
parent 3597bce3e5
commit ceb8553e4a

View File

@ -177,6 +177,7 @@ Array VoxelInstanceLibraryItem::serialize_multimesh_item_properties() const {
}
void VoxelInstanceLibraryItem::deserialize_multimesh_item_properties(Array a) {
ERR_FAIL_COND(a.size() != _mesh_lods.size() + 6);
int ai = 0;
for (unsigned int i = 0; i < _mesh_lods.size(); ++i) {
_mesh_lods[i] = a[ai++];