From 7af6a2b9e7e044fdc06bf8916bc05facc1e7f748 Mon Sep 17 00:00:00 2001 From: TimeServ Date: Tue, 15 Mar 2005 02:57:02 +0000 Subject: [PATCH] stuff I needed to fix git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@898 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/cl_tent.c | 5 ++--- engine/client/r_part.c | 9 +++++++++ engine/common/particles.h | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/engine/client/cl_tent.c b/engine/client/cl_tent.c index 9103729aa..7d6212445 100644 --- a/engine/client/cl_tent.c +++ b/engine/client/cl_tent.c @@ -876,9 +876,8 @@ void CL_ParseTEnt (void) // count cnt = MSG_ReadByte (); - rnd = FindParticleType("te_flamejet"); - if (R_RunParticleEffectType(pos, pos2, cnt, rnd)) - R_RunParticleEffect (pos, pos2, 232, cnt); + if (P_RunParticleEffectTypeString(pos, pos2, cnt, "te_flamejet")) + P_RunParticleEffect (pos, pos2, 232, cnt); break; case 75://TE_PLASMABURN diff --git a/engine/client/r_part.c b/engine/client/r_part.c index 86d3ac7d0..86251fb89 100644 --- a/engine/client/r_part.c +++ b/engine/client/r_part.c @@ -1551,6 +1551,15 @@ void P_BlobExplosion (vec3_t org) P_RunParticleEffectType(org, NULL, 1, pt_blob); } +int P_RunParticleEffectTypeString (vec3_t org, vec3_t dir, float count, char *name) +{ + int type = P_FindParticleType(name); + if (type < 0) + return 1; + + return P_RunParticleEffectType(org, dir, count, type); +} + int P_RunParticleEffectType (vec3_t org, vec3_t dir, float count, int typenum) { part_type_t *ptype = &part_type[typenum]; diff --git a/engine/common/particles.h b/engine/common/particles.h index 4ea4404a4..d2b6bcd78 100644 --- a/engine/common/particles.h +++ b/engine/common/particles.h @@ -130,7 +130,7 @@ void P_DefaultTrail (struct model_s *model); //fills in the default particle pro //the core spawn function for point effects int P_RunParticleEffectType(vec3_t org, vec3_t dir, float count, int type); //1 if failed. - +int P_RunParticleEffectTypeString (vec3_t org, vec3_t dir, float count, char *name); //1 if failed. void P_EmitSkyEffectTris(struct model_s *mod, struct msurface_s *fa);