Browse Source

Fix particle system from going inactive early

Prevents particles from freezing and dissapearing by resetting
it's inactive time when particles are emitted.
GanidhuAbey 3 years ago
parent
commit
3c95a70081
1 changed files with 2 additions and 5 deletions
  1. 2 5
      servers/rendering/renderer_rd/storage_rd/particles_storage.cpp

+ 2 - 5
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) {