From: havoc Date: Tue, 11 May 2010 09:35:29 +0000 (+0000) Subject: append maps/mapname_effectinfo.txt as intended X-Git-Tag: xonotic-v0.1.0preview~230^2~288 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=369153300a877f32ec3c0e4ea112cf2ac5bb20bf;p=xonotic%2Fdarkplaces.git append maps/mapname_effectinfo.txt as intended git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10190 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_particles.c b/cl_particles.c index 1dc96a8b..3d6e709b 100644 --- a/cl_particles.c +++ b/cl_particles.c @@ -123,7 +123,7 @@ particleeffectinfo_t; char particleeffectname[MAX_PARTICLEEFFECTNAME][64]; - +int numparticleeffectinfo; particleeffectinfo_t particleeffectinfo[MAX_PARTICLEEFFECTINFO]; static int particlepalette[256]; @@ -230,12 +230,11 @@ void CL_Particles_ParseEffectInfo(const char *textstart, const char *textend, co { int arrayindex; int argc; - int effectinfoindex; int linenumber; particleeffectinfo_t *info = NULL; const char *text = textstart; char argv[16][1024]; - effectinfoindex = -1; + numparticleeffectinfo = 0; for (linenumber = 1;;linenumber++) { argc = 0; @@ -265,8 +264,7 @@ void CL_Particles_ParseEffectInfo(const char *textstart, const char *textend, co { int effectnameindex; checkparms(2); - effectinfoindex++; - if (effectinfoindex >= MAX_PARTICLEEFFECTINFO) + if (numparticleeffectinfo >= MAX_PARTICLEEFFECTINFO) { Con_Printf("%s:%i: too many effects!\n", filename, linenumber); break; @@ -290,7 +288,7 @@ void CL_Particles_ParseEffectInfo(const char *textstart, const char *textend, co Con_Printf("%s:%i: too many effects!\n", filename, linenumber); break; } - info = particleeffectinfo + effectinfoindex; + info = particleeffectinfo + numparticleeffectinfo++; info->effectnameindex = effectnameindex; info->particletype = pt_alphastatic; info->blendmode = particletype[info->particletype].blendmode; @@ -471,6 +469,7 @@ void CL_Particles_LoadEffectInfo(void) unsigned char *filedata; fs_offset_t filesize; char filename[MAX_QPATH]; + numparticleeffectinfo = 0; memset(particleeffectinfo, 0, sizeof(particleeffectinfo)); memset(particleeffectname, 0, sizeof(particleeffectname)); for (i = 0;i < EFFECT_TOTAL;i++)