Merge pull request #47097 from ignacioabal/master

Added validation when assigning heightfield_resolution (Fix #46281)
This commit is contained in:
Rémi Verschelde 2021-03-17 16:39:52 +01:00 committed by GitHub
commit db08e64a02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5121,6 +5121,7 @@ void RendererStorageRD::particles_collision_height_field_update(RID p_particles_
void RendererStorageRD::particles_collision_set_height_field_resolution(RID p_particles_collision, RS::ParticlesCollisionHeightfieldResolution p_resolution) {
ParticlesCollision *particles_collision = particles_collision_owner.getornull(p_particles_collision);
ERR_FAIL_COND(!particles_collision);
ERR_FAIL_INDEX(p_resolution, RS::PARTICLES_COLLISION_HEIGHTFIELD_RESOLUTION_MAX);
if (particles_collision->heightfield_resolution == p_resolution) {
return;