summaryrefslogtreecommitdiff
path: root/servers/rendering/renderer_rd/storage_rd
diff options
context:
space:
mode:
authorGanidhuAbey <ganidhu.abey@gmail.com>2022-05-24 17:31:21 -0600
committerGanidhuAbey <ganidhu.abey@gmail.com>2022-05-24 17:31:21 -0600
commit3c95a70081b7394ccaa4300b205f93eb0c490cfb (patch)
treeacfe75a2e6084fd087b0b5eba4eab5ab5948190d /servers/rendering/renderer_rd/storage_rd
parent19e3c7fcd9d3ec533f3e81b4ec77636d32ff9b24 (diff)
Fix particle system from going inactive early
Prevents particles from freezing and dissapearing by resetting it's inactive time when particles are emitted.
Diffstat (limited to 'servers/rendering/renderer_rd/storage_rd')
-rw-r--r--servers/rendering/renderer_rd/storage_rd/particles_storage.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/servers/rendering/renderer_rd/storage_rd/particles_storage.cpp b/servers/rendering/renderer_rd/storage_rd/particles_storage.cpp
index e15d3e13a9..58a96ed1f9 100644
--- a/servers/rendering/renderer_rd/storage_rd/particles_storage.cpp
+++ b/servers/rendering/renderer_rd/storage_rd/particles_storage.cpp
@@ -540,11 +540,8 @@ void ParticlesStorage::particles_emit(RID p_particles, const Transform3D &p_tran
_particles_allocate_emission_buffer(particles);
}
- if (particles->inactive) {
- //in case it was inactive, make active again
- particles->inactive = false;
- particles->inactive_time = 0;
- }
+ particles->inactive = false;
+ particles->inactive_time = 0;
int32_t idx = particles->emission_buffer->particle_count;
if (idx < particles->emission_buffer->particle_max) {