From 3c95a70081b7394ccaa4300b205f93eb0c490cfb Mon Sep 17 00:00:00 2001 From: GanidhuAbey Date: Tue, 24 May 2022 17:31:21 -0600 Subject: Fix particle system from going inactive early Prevents particles from freezing and dissapearing by resetting it's inactive time when particles are emitted. --- servers/rendering/renderer_rd/storage_rd/particles_storage.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'servers/rendering/renderer_rd/storage_rd') 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) { -- cgit v1.2.3