summaryrefslogtreecommitdiff
path: root/scene/3d
diff options
context:
space:
mode:
Diffstat (limited to 'scene/3d')
-rw-r--r--scene/3d/cpu_particles.cpp6
-rw-r--r--scene/3d/cpu_particles.h1
2 files changed, 6 insertions, 1 deletions
diff --git a/scene/3d/cpu_particles.cpp b/scene/3d/cpu_particles.cpp
index 0ac424b09e..aa7a413548 100644
--- a/scene/3d/cpu_particles.cpp
+++ b/scene/3d/cpu_particles.cpp
@@ -405,7 +405,7 @@ bool CPUParticles::get_particle_flag(Flags p_flag) const {
}
void CPUParticles::set_emission_shape(EmissionShape p_shape) {
-
+ ERR_FAIL_INDEX(p_shape, EMISSION_SHAPE_MAX);
emission_shape = p_shape;
}
@@ -784,6 +784,9 @@ void CPUParticles::_particles_process(float p_delta) {
p.base_color = emission_colors.get(random_idx);
}
} break;
+ case EMISSION_SHAPE_MAX: { // Max value for validity check.
+ break;
+ }
}
if (!local_coords) {
@@ -1488,6 +1491,7 @@ void CPUParticles::_bind_methods() {
BIND_ENUM_CONSTANT(EMISSION_SHAPE_BOX);
BIND_ENUM_CONSTANT(EMISSION_SHAPE_POINTS);
BIND_ENUM_CONSTANT(EMISSION_SHAPE_DIRECTED_POINTS);
+ BIND_ENUM_CONSTANT(EMISSION_SHAPE_MAX);
}
CPUParticles::CPUParticles() {
diff --git a/scene/3d/cpu_particles.h b/scene/3d/cpu_particles.h
index 18f9718e70..d5a549b976 100644
--- a/scene/3d/cpu_particles.h
+++ b/scene/3d/cpu_particles.h
@@ -75,6 +75,7 @@ public:
EMISSION_SHAPE_BOX,
EMISSION_SHAPE_POINTS,
EMISSION_SHAPE_DIRECTED_POINTS,
+ EMISSION_SHAPE_MAX
};
private: