From 79b47065c7c24f8125cbb8474690d4807b34f93a Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Mon, 2 Aug 2021 13:33:52 +0200 Subject: [PATCH] Moved particle callbacks to Unity above the original particle effect code, so that if the "no more particles" return branch is taken, the effect will still be forwarded to Unity. Fixes missing particle effects in some scenes. --- engine/Quake/r_part.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/engine/Quake/r_part.c b/engine/Quake/r_part.c index cb32595..99c87d0 100644 --- a/engine/Quake/r_part.c +++ b/engine/Quake/r_part.c @@ -361,6 +361,8 @@ R_ParticleExplosion */ void R_ParticleExplosion (vec3_t org) { + UQ_Game_ParticleExplosion(org); + #ifdef USE_OPENGL int i, j; particle_t *p; @@ -397,8 +399,6 @@ void R_ParticleExplosion (vec3_t org) } } #endif - - UQ_Game_ParticleExplosion(org); } /* @@ -489,6 +489,11 @@ R_RunParticleEffect */ void R_RunParticleEffect (vec3_t org, vec3_t dir, int color, int count) { + if (count == 1024) + UQ_Game_ParticleExplosion(org); + else + UQ_Game_RunParticleEffect(org, dir, color, count); + #ifdef USE_OPENGL int i, j; particle_t *p; @@ -539,11 +544,6 @@ void R_RunParticleEffect (vec3_t org, vec3_t dir, int color, int count) } } #endif - - if (count == 1024) - UQ_Game_ParticleExplosion(org); - else - UQ_Game_RunParticleEffect(org, dir, color, count); } /* @@ -553,6 +553,8 @@ R_LavaSplash */ void R_LavaSplash (vec3_t org) { + UQ_Game_LavaSplash(org); + #ifdef USE_OPENGL int i, j, k; particle_t *p; @@ -587,8 +589,6 @@ void R_LavaSplash (vec3_t org) VectorScale (dir, vel, p->vel); } #endif - - UQ_Game_LavaSplash(org); } /* @@ -598,6 +598,8 @@ R_TeleportSplash */ void R_TeleportSplash (vec3_t org) { + UQ_Game_TeleportSplash(org); + #ifdef USE_OPENGL int i, j, k; particle_t *p; @@ -632,8 +634,6 @@ void R_TeleportSplash (vec3_t org) VectorScale (dir, vel, p->vel); } #endif - - UQ_Game_TeleportSplash(org); } /*