From ea79349c2d04822a653b790db191c0f93ec74a47 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 20 Feb 2002 18:35:49 +0000 Subject: [PATCH] nq world.c and qw world.c are now identical ignoring the $Id line --- nq/include/server.h | 2 ++ nq/source/sv_main.c | 13 +++++++++++++ nq/source/world.c | 25 ++++--------------------- qw/source/world.c | 19 ++----------------- 4 files changed, 21 insertions(+), 38 deletions(-) diff --git a/nq/include/server.h b/nq/include/server.h index 475a94dd6..b2fde2e25 100644 --- a/nq/include/server.h +++ b/nq/include/server.h @@ -267,6 +267,8 @@ void SV_RunClients (void); void SV_SaveSpawnparms (); void SV_SpawnServer (const char *server); +void SV_Error (const char *error, ...) __attribute__((format(printf,1,2))); + void SV_LoadProgs (void); void SV_Progs_Init (void); void SV_Progs_Init_Cvars (void); diff --git a/nq/source/sv_main.c b/nq/source/sv_main.c index a09e9a066..2e871add4 100644 --- a/nq/source/sv_main.c +++ b/nq/source/sv_main.c @@ -1040,3 +1040,16 @@ SV_SpawnServer (const char *server) 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); +} diff --git a/nq/source/world.c b/nq/source/world.c index e2afed12f..b99ef627f 100644 --- a/nq/source/world.c +++ b/nq/source/world.c @@ -42,7 +42,6 @@ static const char rcsid[] = #include "QF/clip_hull.h" #include "QF/console.h" #include "QF/crc.h" -#include "QF/sys.h" #include "compat.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) { // explicit hulls in the BSP model 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)]; 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]; } @@ -420,7 +419,7 @@ SV_HullPointContents (hull_t *hull, int num, const vec3_t p) while (num >= 0) { 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; 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; } -#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 // mid is on the correct side of the plane if (side) @@ -658,7 +641,7 @@ SV_ClipToLinks (areanode_t *node, moveclip_t * clip) if (touch == clip->passedict) continue; 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) != SOLID_BSP) diff --git a/qw/source/world.c b/qw/source/world.c index 69492dfb0..b99ef627f 100644 --- a/qw/source/world.c +++ b/qw/source/world.c @@ -560,22 +560,6 @@ SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, 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 // mid is on the correct side of the plane 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)); // 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.end = end;