nq world.c and qw world.c are now identical ignoring the $Id line

This commit is contained in:
Bill Currie 2002-02-20 18:35:49 +00:00
parent 4ab577a75f
commit ea79349c2d
4 changed files with 21 additions and 38 deletions

View file

@ -267,6 +267,8 @@ void SV_RunClients (void);
void SV_SaveSpawnparms (); void SV_SaveSpawnparms ();
void SV_SpawnServer (const char *server); void SV_SpawnServer (const char *server);
void SV_Error (const char *error, ...) __attribute__((format(printf,1,2)));
void SV_LoadProgs (void); void SV_LoadProgs (void);
void SV_Progs_Init (void); void SV_Progs_Init (void);
void SV_Progs_Init_Cvars (void); void SV_Progs_Init_Cvars (void);

View file

@ -1040,3 +1040,16 @@ SV_SpawnServer (const char *server)
Con_DPrintf ("Server spawned.\n"); Con_DPrintf ("Server spawned.\n");
} }
void
SV_Error (const char *error, ...)
{
va_list argptr;
static char string[1024];
va_start (argptr, error);
vsnprintf (string, sizeof (string), error, argptr);
va_end (argptr);
Host_Error ("%s", string);
}

View file

@ -42,7 +42,6 @@ static const char rcsid[] =
#include "QF/clip_hull.h" #include "QF/clip_hull.h"
#include "QF/console.h" #include "QF/console.h"
#include "QF/crc.h" #include "QF/crc.h"
#include "QF/sys.h"
#include "compat.h" #include "compat.h"
#include "server.h" #include "server.h"
@ -167,12 +166,12 @@ SV_HullForEntity (edict_t *ent, const vec3_t mins, const vec3_t maxs,
} if (SVfloat (ent, solid) == SOLID_BSP) { } if (SVfloat (ent, solid) == SOLID_BSP) {
// explicit hulls in the BSP model // explicit hulls in the BSP model
if (SVfloat (ent, movetype) != MOVETYPE_PUSH) if (SVfloat (ent, movetype) != MOVETYPE_PUSH)
Sys_Error ("SOLID_BSP without MOVETYPE_PUSH"); SV_Error ("SOLID_BSP without MOVETYPE_PUSH");
model = sv.models[(int) SVfloat (ent, modelindex)]; model = sv.models[(int) SVfloat (ent, modelindex)];
if (!model || model->type != mod_brush) if (!model || model->type != mod_brush)
Sys_Error ("MOVETYPE_PUSH with a non bsp model"); SV_Error ("SOLID_BSP with a non bsp model");
hull = &model->hulls[hull_index]; hull = &model->hulls[hull_index];
} }
@ -420,7 +419,7 @@ SV_HullPointContents (hull_t *hull, int num, const vec3_t p)
while (num >= 0) { while (num >= 0) {
if (num < hull->firstclipnode || num > hull->lastclipnode) if (num < hull->firstclipnode || num > hull->lastclipnode)
Sys_Error ("SV_HullPointContents: bad node number"); SV_Error ("SV_HullPointContents: bad node number");
node = hull->clipnodes + num; node = hull->clipnodes + num;
plane = hull->planes + node->planenum; plane = hull->planes + node->planenum;
@ -561,22 +560,6 @@ SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f,
trace->plane.dist = -plane->dist; trace->plane.dist = -plane->dist;
} }
#if 0 //XXX I don't think this is needed any more, but leave it in for now
while (SV_HullPointContents (hull, hull->firstclipnode, mid)
== CONTENTS_SOLID) {
// shouldn't really happen, but does occasionally
frac -= 0.1;
if (frac < 0) {
trace->fraction = midf;
VectorCopy (mid, trace->endpos);
Con_DPrintf ("backup past 0\n");
return false;
}
midf = p1f + (p2f - p1f) * frac;
for (i = 0; i < 3; i++)
mid[i] = p1[i] + frac * (p2[i] - p1[i]);
}
#endif
// put the crosspoint DIST_EPSILON pixels on the near side to guarantee // put the crosspoint DIST_EPSILON pixels on the near side to guarantee
// mid is on the correct side of the plane // mid is on the correct side of the plane
if (side) if (side)
@ -658,7 +641,7 @@ SV_ClipToLinks (areanode_t *node, moveclip_t * clip)
if (touch == clip->passedict) if (touch == clip->passedict)
continue; continue;
if (SVfloat (touch, solid) == SOLID_TRIGGER) if (SVfloat (touch, solid) == SOLID_TRIGGER)
Sys_Error ("Trigger in clipping list"); SV_Error ("Trigger in clipping list");
if (clip->type == MOVE_NOMONSTERS && SVfloat (touch, solid) if (clip->type == MOVE_NOMONSTERS && SVfloat (touch, solid)
!= SOLID_BSP) != SOLID_BSP)

View file

@ -560,22 +560,6 @@ SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f,
trace->plane.dist = -plane->dist; trace->plane.dist = -plane->dist;
} }
#if 0 //XXX I don't think this is needed any more, but leave it in for now
while (SV_HullPointContents (hull, hull->firstclipnode, mid)
== CONTENTS_SOLID) {
// shouldn't really happen, but does occasionally
frac -= 0.1;
if (frac < 0) {
trace->fraction = midf;
VectorCopy (mid, trace->endpos);
SV_Printf ("backup past 0\n");
return false;
}
midf = p1f + (p2f - p1f) * frac;
for (i = 0; i < 3; i++)
mid[i] = p1[i] + frac * (p2[i] - p1[i]);
}
#endif
// put the crosspoint DIST_EPSILON pixels on the near side to guarantee // put the crosspoint DIST_EPSILON pixels on the near side to guarantee
// mid is on the correct side of the plane // mid is on the correct side of the plane
if (side) if (side)
@ -748,7 +732,8 @@ SV_Move (const vec3_t start, const vec3_t mins, const vec3_t maxs,
memset (&clip, 0, sizeof (moveclip_t)); memset (&clip, 0, sizeof (moveclip_t));
// clip to world // clip to world
clip.trace = SV_ClipMoveToEntity (sv.edicts, passedict, start, mins, maxs, end); clip.trace = SV_ClipMoveToEntity (sv.edicts, passedict, start,
mins, maxs, end);
clip.start = start; clip.start = start;
clip.end = end; clip.end = end;