mirror of
https://github.com/yquake2/zaero.git
synced 2024-11-25 05:11:18 +00:00
A few fixes from q2dos
This commit is contained in:
parent
3fabd3c09c
commit
2bcbd86a61
3 changed files with 26 additions and 5 deletions
|
@ -684,8 +684,10 @@ void SV_Physics_Pusher (edict_t *ent)
|
|||
break; // move was blocked
|
||||
}
|
||||
}
|
||||
if (pushed_p > &pushed[MAX_EDICTS])
|
||||
gi.error (ERR_FATAL, "pushed_p > &pushed[MAX_EDICTS], memory corrupted");
|
||||
if (pushed_p > &pushed[MAX_EDICTS-1])
|
||||
{
|
||||
gi.error (ERR_FATAL, "pushed_p > &pushed[MAX_EDICTS-1], memory corrupted");
|
||||
}
|
||||
|
||||
if (part)
|
||||
{
|
||||
|
|
|
@ -310,10 +310,10 @@ vec3_t corners[2];
|
|||
int
|
||||
BoxOnPlaneSide2(vec3_t emins, vec3_t emaxs, struct cplane_s *p)
|
||||
{
|
||||
int i;
|
||||
//int i; // DG: I think it's supposed to write to the global!
|
||||
float dist1, dist2;
|
||||
int sides;
|
||||
vec3_t corners[2];
|
||||
//vec3_t corners[2]; // DG: ditto
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
|
@ -680,6 +680,12 @@ COM_FileBase(char *in, char *out)
|
|||
{
|
||||
char *s, *s2;
|
||||
|
||||
if(!in[0])
|
||||
{
|
||||
out[0] = '\0';
|
||||
return;
|
||||
}
|
||||
|
||||
s = in + strlen(in) - 1;
|
||||
|
||||
while (s != in && *s != '.')
|
||||
|
@ -711,6 +717,12 @@ COM_FilePath(const char *in, char *out)
|
|||
{
|
||||
const char *s;
|
||||
|
||||
if(!in[0])
|
||||
{
|
||||
out[0] = '\0';
|
||||
return;
|
||||
}
|
||||
|
||||
s = in + strlen(in) - 1;
|
||||
|
||||
while (s != in && *s != '/')
|
||||
|
@ -727,6 +739,11 @@ COM_DefaultExtension(char *path, const char *extension)
|
|||
{
|
||||
char *src;
|
||||
|
||||
if(!path[0])
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* */
|
||||
/* if path doesn't have a .EXT, append extension */
|
||||
/* (extension should include the .) */
|
||||
|
|
|
@ -171,6 +171,7 @@ void tripbomb_laser_think (edict_t *self)
|
|||
// randomly phase out or EMPNuke is in effect
|
||||
if (EMPNukeCheck(self, self->s.origin) || random() < 0.1)
|
||||
{
|
||||
self->svflags |= SVF_NOCLIENT;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1045,9 +1046,10 @@ void fire_sniper_bullet (edict_t *self, vec3_t start, vec3_t aimdir, int damage,
|
|||
vec3_t end;
|
||||
vec3_t s;
|
||||
edict_t *ignore = self;
|
||||
int i = 0;
|
||||
VectorMA (start, 8192, aimdir, end);
|
||||
VectorCopy(start, s);
|
||||
while(1)
|
||||
for(i=0;i<256;++i) // DG: prevent infinite loop (adapted from q2dos)
|
||||
{
|
||||
tr = gi.trace (s, NULL, NULL, end, ignore, MASK_SHOT_NO_WINDOW);
|
||||
if (tr.fraction >= 1.0)
|
||||
|
|
Loading…
Reference in a new issue