void R_ParticleCube (vec3_t mins, vec3_t maxs, vec3_t dir, int count, int colorbase, int gravity, int randomvel);
void R_ParticleRain (vec3_t mins, vec3_t maxs, vec3_t dir, int count, int colorbase, int type);
+// attempts to find the nearest non-solid location, used for explosions mainly
+void FindNonSolidLocation(vec3_t pos)
+{
+ if (SV_HullPointContents (cl.worldmodel->hulls, 0, pos) != CONTENTS_SOLID) return;
+ pos[0]-=1;if (SV_HullPointContents (cl.worldmodel->hulls, 0, pos) != CONTENTS_SOLID) return;
+ pos[0]+=2;if (SV_HullPointContents (cl.worldmodel->hulls, 0, pos) != CONTENTS_SOLID) return;
+ pos[0]-=1;
+ pos[1]-=1;if (SV_HullPointContents (cl.worldmodel->hulls, 0, pos) != CONTENTS_SOLID) return;
+ pos[1]+=2;if (SV_HullPointContents (cl.worldmodel->hulls, 0, pos) != CONTENTS_SOLID) return;
+ pos[1]-=1;
+ pos[2]-=1;if (SV_HullPointContents (cl.worldmodel->hulls, 0, pos) != CONTENTS_SOLID) return;
+ pos[2]+=2;if (SV_HullPointContents (cl.worldmodel->hulls, 0, pos) != CONTENTS_SOLID) return;
+ pos[2]-=1;
+}
+
/*
=================
CL_ParseTEnt
pos[0] = MSG_ReadCoord ();
pos[1] = MSG_ReadCoord ();
pos[2] = MSG_ReadCoord ();
+ FindNonSolidLocation(pos);
R_ParticleExplosion (pos, false);
// R_BlastParticles (pos, 120, 120);
dl = CL_AllocDlight (0);
pos[0] = MSG_ReadCoord ();
pos[1] = MSG_ReadCoord ();
pos[2] = MSG_ReadCoord ();
+ FindNonSolidLocation(pos);
R_ParticleExplosion (pos, false);
// R_BlastParticles (pos, 120, 480);
dl = CL_AllocDlight (0);
pos[0] = MSG_ReadCoord ();
pos[1] = MSG_ReadCoord ();
pos[2] = MSG_ReadCoord ();
+ FindNonSolidLocation(pos);
R_ParticleExplosion (pos, true);
dl = CL_AllocDlight (0);
VectorCopy (pos, dl->origin);
pos[0] = MSG_ReadCoord ();
pos[1] = MSG_ReadCoord ();
pos[2] = MSG_ReadCoord ();
+ FindNonSolidLocation(pos);
R_ParticleExplosion (pos, false);
// R_BlastParticles (pos, 120, 120);
dl = CL_AllocDlight (0);
pos[0] = MSG_ReadCoord ();
pos[1] = MSG_ReadCoord ();
pos[2] = MSG_ReadCoord ();
+ FindNonSolidLocation(pos);
R_ParticleExplosion (pos, false);
// R_BlastParticles (pos, 120, 120);
dl = CL_AllocDlight (0);
pos[0] = MSG_ReadCoord ();
pos[1] = MSG_ReadCoord ();
pos[2] = MSG_ReadCoord ();
+ FindNonSolidLocation(pos);
R_BlobExplosion (pos);
// R_BlastParticles (pos, 120, 120);
pos[0] = MSG_ReadCoord ();
pos[1] = MSG_ReadCoord ();
pos[2] = MSG_ReadCoord ();
+ FindNonSolidLocation(pos);
colorStart = MSG_ReadByte ();
colorLength = MSG_ReadByte ();
R_ParticleExplosion2 (pos, colorStart, colorLength);
cl_visedicts[cl_numvisedicts] = ent;
cl_numvisedicts++;
-// ent->colormap = vid.colormap;
- ent->colormap = 0;
+ ent->colormap = -1; // no special coloring
ent->scale = 1;
ent->alpha = 1;
ent->colormod[0] = ent->colormod[1] = ent->colormod[2] = 1;