Header/whitespace rampage continues.

This commit is contained in:
Ragnvald Maartmann-Moe IV 2001-08-28 03:47:10 +00:00
parent f4fd3178f4
commit b1c0bb7626
6 changed files with 306 additions and 461 deletions

View file

@ -32,11 +32,12 @@
#include <math.h> #include <math.h>
#include "QF/cvar.h"
#include "QF/qtypes.h"
#include "client.h" #include "client.h"
#include "compat.h" #include "compat.h"
#include "QF/cvar.h"
#include "pmove.h" #include "pmove.h"
#include "QF/qtypes.h"
cvar_t *no_pogo_stick; cvar_t *no_pogo_stick;
movevars_t movevars; movevars_t movevars;
@ -57,6 +58,7 @@ vec3_t player_maxs = { 16, 16, 32 };
void PM_InitBoxHull (void); void PM_InitBoxHull (void);
void PM_CategorizePosition (void); void PM_CategorizePosition (void);
void void
Pmove_Init (void) Pmove_Init (void)
{ {
@ -71,23 +73,18 @@ Pmove_Init_Cvars (void)
} }
#define STEPSIZE 18 #define STEPSIZE 18
#define BUTTON_JUMP 2 #define BUTTON_JUMP 2
/* /*
PM_ClipVelocity PM_ClipVelocity
Slide off of the impacting object Slide off of the impacting object
returns the blocked flags (1 = floor, 2 = step / wall) returns the blocked flags (1 = floor, 2 = step / wall)
*/ */
int int
PM_ClipVelocity (vec3_t in, vec3_t normal, vec3_t out, float overbounce) PM_ClipVelocity (vec3_t in, vec3_t normal, vec3_t out, float overbounce)
{ {
float backoff; float backoff, change;
float change;
int i, blocked; int i, blocked;
blocked = 0; blocked = 0;
@ -108,7 +105,6 @@ PM_ClipVelocity (vec3_t in, vec3_t normal, vec3_t out, float overbounce)
return blocked; return blocked;
} }
/* /*
PM_FlyMove PM_FlyMove
@ -119,17 +115,12 @@ PM_ClipVelocity (vec3_t in, vec3_t normal, vec3_t out, float overbounce)
int int
PM_FlyMove (void) PM_FlyMove (void)
{ {
int bumpcount, numbumps; int blocked, bumpcount, numbumps, numplanes, i, j;
vec3_t dir; vec3_t dir;
float d; float time_left, d;
int numplanes;
vec3_t planes[MAX_CLIP_PLANES];
vec3_t primal_velocity, original_velocity;
int i, j;
pmtrace_t trace; pmtrace_t trace;
vec3_t end; vec3_t planes[MAX_CLIP_PLANES];
float time_left; vec3_t end, primal_velocity, original_velocity;
int blocked;
numbumps = 4; numbumps = 4;
@ -182,9 +173,7 @@ PM_FlyMove (void)
VectorCopy (trace.plane.normal, planes[numplanes]); VectorCopy (trace.plane.normal, planes[numplanes]);
numplanes++; numplanes++;
//
// modify original_velocity so it parallels all of the clip planes // modify original_velocity so it parallels all of the clip planes
//
for (i = 0; i < numplanes; i++) { for (i = 0; i < numplanes; i++) {
PM_ClipVelocity (original_velocity, planes[i], pmove.velocity, 1); PM_ClipVelocity (original_velocity, planes[i], pmove.velocity, 1);
for (j = 0; j < numplanes; j++) for (j = 0; j < numplanes; j++)
@ -208,10 +197,8 @@ PM_FlyMove (void)
VectorScale (dir, d, pmove.velocity); VectorScale (dir, d, pmove.velocity);
} }
//
// if original velocity is against the original velocity, stop dead // if original velocity is against the original velocity, stop dead
// to avoid tiny occilations in sloping corners // to avoid tiny occilations in sloping corners
//
if (DotProduct (pmove.velocity, primal_velocity) <= 0) { if (DotProduct (pmove.velocity, primal_velocity) <= 0) {
VectorCopy (vec3_origin, pmove.velocity); VectorCopy (vec3_origin, pmove.velocity);
break; break;
@ -224,7 +211,6 @@ PM_FlyMove (void)
return blocked; return blocked;
} }
void PM_Accelerate (vec3_t, float, float); void PM_Accelerate (vec3_t, float, float);
/* /*
@ -236,17 +222,16 @@ void PM_Accelerate (vec3_t, float, float);
void void
PM_FlymodeMove (void) PM_FlymodeMove (void)
{ {
vec3_t start, dest, pmvel, pmtmp;
pmtrace_t trace;
float pmspeed; float pmspeed;
pmtrace_t trace;
vec3_t start, dest, pmvel, pmtmp;
pmvel[0] = pmvel[0] = forward[0] * pmove.cmd.forwardmove +
forward[0] * pmove.cmd.forwardmove + right[0] * pmove.cmd.sidemove; right[0] * pmove.cmd.sidemove;
pmvel[1] = pmvel[1] = forward[1] * pmove.cmd.forwardmove +
forward[1] * pmove.cmd.forwardmove + right[1] * pmove.cmd.sidemove; right[1] * pmove.cmd.sidemove;
pmvel[2] = pmvel[2] = forward[2] * pmove.cmd.forwardmove +
forward[2] * pmove.cmd.forwardmove + right[2] * pmove.cmd.sidemove + right[2] * pmove.cmd.sidemove + pmove.cmd.upmove;
pmove.cmd.upmove;
VectorCopy (pmvel, pmtmp); VectorCopy (pmvel, pmtmp);
pmspeed = VectorNormalize (pmtmp); // don't alter pmvel pmspeed = VectorNormalize (pmtmp); // don't alter pmvel
@ -270,7 +255,6 @@ PM_FlymodeMove (void)
PM_FlyMove (); // NOW we fly. PM_FlyMove (); // NOW we fly.
} }
/* /*
PM_GroundMove PM_GroundMove
@ -279,10 +263,10 @@ PM_FlymodeMove (void)
void void
PM_GroundMove (void) PM_GroundMove (void)
{ {
vec3_t start, dest;
pmtrace_t trace;
vec3_t original, originalvel, down, up, downvel;
float downdist, updist; float downdist, updist;
pmtrace_t trace;
vec3_t start, dest;
vec3_t original, originalvel, down, up, downvel;
pmove.velocity[2] = 0; pmove.velocity[2] = 0;
if (!pmove.velocity[0] && !pmove.velocity[1] && !pmove.velocity[2]) if (!pmove.velocity[0] && !pmove.velocity[1] && !pmove.velocity[2])
@ -349,11 +333,8 @@ PM_GroundMove (void)
pmove.velocity[2] = downvel[2]; pmove.velocity[2] = downvel[2];
// if at a dead stop, retry the move with nudges to get around lips // if at a dead stop, retry the move with nudges to get around lips
} }
/* /*
PM_Friction PM_Friction
@ -363,11 +344,9 @@ void
PM_Friction (void) PM_Friction (void)
{ {
float *vel; float *vel;
float speed, newspeed; float drop, friction, speed, newspeed;
float friction;
float drop;
vec3_t start, stop;
pmtrace_t trace; pmtrace_t trace;
vec3_t start, stop;
if (pmove.waterjumptime) if (pmove.waterjumptime)
return; return;
@ -417,15 +396,11 @@ PM_Friction (void)
vel[2] = vel[2] * newspeed; vel[2] = vel[2] * newspeed;
} }
/*
PM_Accelerate
*/
void void
PM_Accelerate (vec3_t wishdir, float wishspeed, float accel) PM_Accelerate (vec3_t wishdir, float wishspeed, float accel)
{ {
int i;
float addspeed, accelspeed, currentspeed; float addspeed, accelspeed, currentspeed;
int i;
if (pmove.dead) if (pmove.dead)
return; return;
@ -447,8 +422,8 @@ PM_Accelerate (vec3_t wishdir, float wishspeed, float accel)
void void
PM_AirAccelerate (vec3_t wishdir, float wishspeed, float accel) PM_AirAccelerate (vec3_t wishdir, float wishspeed, float accel)
{ {
int i;
float addspeed, accelspeed, currentspeed, wishspd = wishspeed; float addspeed, accelspeed, currentspeed, wishspd = wishspeed;
int i;
if (pmove.dead) if (pmove.dead)
return; return;
@ -469,24 +444,15 @@ PM_AirAccelerate (vec3_t wishdir, float wishspeed, float accel)
pmove.velocity[i] += accelspeed * wishdir[i]; pmove.velocity[i] += accelspeed * wishdir[i];
} }
/*
PM_WaterMove
*/
void void
PM_WaterMove (void) PM_WaterMove (void)
{ {
int i;
vec3_t wishvel;
float wishspeed; float wishspeed;
vec3_t wishdir; int i;
vec3_t start, dest;
pmtrace_t trace; pmtrace_t trace;
vec3_t start, dest, wishdir, wishvel;
//
// user intentions // user intentions
//
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
wishvel[i] = wishvel[i] =
forward[i] * pmove.cmd.forwardmove + right[i] * pmove.cmd.sidemove; forward[i] * pmove.cmd.forwardmove + right[i] * pmove.cmd.sidemove;
@ -505,11 +471,10 @@ PM_WaterMove (void)
} }
wishspeed *= 0.7; wishspeed *= 0.7;
//
// water acceleration // water acceleration
//
// if (pmove.waterjumptime) // if (pmove.waterjumptime)
// Con_Printf ("wm->%f, %f, %f\n", pmove.velocity[0], pmove.velocity[1], pmove.velocity[2]); // Con_Printf ("wm->%f, %f, %f\n", pmove.velocity[0], pmove.velocity[1],
// pmove.velocity[2]);
PM_Accelerate (wishdir, wishspeed, movevars.wateraccelerate); PM_Accelerate (wishdir, wishspeed, movevars.wateraccelerate);
// assume it is a stair or a slope, so press down from stepheight above // assume it is a stair or a slope, so press down from stepheight above
@ -526,19 +491,12 @@ PM_WaterMove (void)
PM_FlyMove (); PM_FlyMove ();
} }
/*
PM_AirMove
*/
void void
PM_AirMove (void) PM_AirMove (void)
{ {
int i; int i;
vec3_t wishvel; vec3_t original, wishdir, wishvel;
float fmove, smove; float fmove, smove, wishspeed;
vec3_t wishdir;
float wishspeed;
vec3_t original;
fmove = pmove.cmd.forwardmove; fmove = pmove.cmd.forwardmove;
smove = pmove.cmd.sidemove; smove = pmove.cmd.sidemove;
@ -555,9 +513,7 @@ PM_AirMove (void)
VectorCopy (wishvel, wishdir); VectorCopy (wishvel, wishdir);
wishspeed = VectorNormalize (wishdir); wishspeed = VectorNormalize (wishdir);
//
// clamp to server defined max speed // clamp to server defined max speed
//
if (wishspeed > movevars.maxspeed) { if (wishspeed > movevars.maxspeed) {
VectorScale (wishvel, movevars.maxspeed / wishspeed, wishvel); VectorScale (wishvel, movevars.maxspeed / wishspeed, wishvel);
wishspeed = movevars.maxspeed; wishspeed = movevars.maxspeed;
@ -566,7 +522,8 @@ PM_AirMove (void)
if (onground != -1) { if (onground != -1) {
pmove.velocity[2] = 0; pmove.velocity[2] = 0;
PM_Accelerate (wishdir, wishspeed, movevars.accelerate); PM_Accelerate (wishdir, wishspeed, movevars.accelerate);
pmove.velocity[2] -= movevars.entgravity * movevars.gravity * frametime; pmove.velocity[2] -= movevars.entgravity * movevars.gravity *
frametime;
PM_GroundMove (); PM_GroundMove ();
} else if (pmove.flying) { } else if (pmove.flying) {
PM_AirAccelerate (wishdir, wishspeed, movevars.accelerate); PM_AirAccelerate (wishdir, wishspeed, movevars.accelerate);
@ -576,7 +533,8 @@ PM_AirMove (void)
PM_AirAccelerate (wishdir, wishspeed, movevars.accelerate); PM_AirAccelerate (wishdir, wishspeed, movevars.accelerate);
// add gravity // add gravity
pmove.velocity[2] -= movevars.entgravity * movevars.gravity * frametime; pmove.velocity[2] -= movevars.entgravity * movevars.gravity *
frametime;
if (!PM_FlyMove ()) { if (!PM_FlyMove ()) {
// the move didn't get blocked // the move didn't get blocked
@ -597,17 +555,12 @@ PM_AirMove (void)
} }
} }
/*
PM_CategorizePosition
*/
void void
PM_CategorizePosition (void) PM_CategorizePosition (void)
{ {
vec3_t point;
int cont; int cont;
pmtrace_t tr; pmtrace_t tr;
vec3_t point;
// if the player hull point one unit down is solid, the player // if the player hull point one unit down is solid, the player
// is on ground // is on ground
@ -636,9 +589,7 @@ PM_CategorizePosition (void)
} }
} }
//
// get waterlevel // get waterlevel
//
waterlevel = 0; waterlevel = 0;
watertype = CONTENTS_EMPTY; watertype = CONTENTS_EMPTY;
@ -660,10 +611,6 @@ PM_CategorizePosition (void)
} }
} }
/*
JumpButton
*/
void void
JumpButton (void) JumpButton (void)
{ {
@ -708,15 +655,11 @@ JumpButton (void)
pmove.oldbuttons |= BUTTON_JUMP; // don't jump again until released pmove.oldbuttons |= BUTTON_JUMP; // don't jump again until released
} }
/*
CheckWaterJump
*/
void void
CheckWaterJump (void) CheckWaterJump (void)
{ {
vec3_t spot;
int cont; int cont;
vec3_t flatforward; vec3_t flatforward, spot;
if (pmove.waterjumptime || pmove.flying) if (pmove.waterjumptime || pmove.flying)
return; return;
@ -757,10 +700,9 @@ CheckWaterJump (void)
void void
NudgePosition (void) NudgePosition (void)
{ {
vec3_t base; int i, x, y, z;
int x, y, z;
int i;
static int sign[3] = { 0, -1, 1 }; static int sign[3] = { 0, -1, 1 };
vec3_t base;
VectorCopy (pmove.origin, base); VectorCopy (pmove.origin, base);
@ -788,22 +730,16 @@ NudgePosition (void)
// Con_DPrintf ("NudgePosition: stuck\n"); // Con_DPrintf ("NudgePosition: stuck\n");
} }
/*
SpectatorMove
*/
void void
SpectatorMove (void) SpectatorMove (void)
{ {
float speed, drop, friction, control, newspeed; float control, drop, friction, fmove, smove, speed, newspeed;
float currentspeed, addspeed, accelspeed; float currentspeed, addspeed, accelspeed, wishspeed;
int i; int i;
vec3_t wishvel; vec3_t wishvel;
float fmove, smove;
vec3_t wishdir; vec3_t wishdir;
float wishspeed;
// friction // friction
speed = Length (pmove.velocity); speed = Length (pmove.velocity);
if (speed < 1) { if (speed < 1) {
VectorCopy (vec3_origin, pmove.velocity) VectorCopy (vec3_origin, pmove.velocity)
@ -837,9 +773,7 @@ SpectatorMove (void)
VectorCopy (wishvel, wishdir); VectorCopy (wishvel, wishdir);
wishspeed = VectorNormalize (wishdir); wishspeed = VectorNormalize (wishdir);
//
// clamp to server defined max speed // clamp to server defined max speed
//
if (wishspeed > movevars.spectatormaxspeed) { if (wishspeed > movevars.spectatormaxspeed) {
VectorScale (wishvel, movevars.spectatormaxspeed / wishspeed, wishvel); VectorScale (wishvel, movevars.spectatormaxspeed / wishspeed, wishvel);
wishspeed = movevars.spectatormaxspeed; wishspeed = movevars.spectatormaxspeed;
@ -856,7 +790,6 @@ SpectatorMove (void)
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
pmove.velocity[i] += accelspeed * wishdir[i]; pmove.velocity[i] += accelspeed * wishdir[i];
// move // move
VectorMA (pmove.origin, frametime, pmove.velocity, pmove.origin); VectorMA (pmove.origin, frametime, pmove.velocity, pmove.origin);
} }

View file

@ -36,13 +36,14 @@
# include <strings.h> # include <strings.h>
#endif #endif
#include "compat.h"
#include "QF/console.h" #include "QF/console.h"
#include "QF/model.h" #include "QF/model.h"
#include "pmove.h"
#include "QF/qtypes.h" #include "QF/qtypes.h"
#include "QF/sys.h" #include "QF/sys.h"
#include "compat.h"
#include "pmove.h"
static hull_t box_hull; static hull_t box_hull;
static dclipnode_t box_clipnodes[6]; static dclipnode_t box_clipnodes[6];
static mplane_t box_planes[6]; static mplane_t box_planes[6];
@ -50,6 +51,7 @@ static mplane_t box_planes[6];
extern vec3_t player_mins; extern vec3_t player_mins;
extern vec3_t player_maxs; extern vec3_t player_maxs;
/* /*
PM_InitBoxHull PM_InitBoxHull
@ -59,8 +61,7 @@ extern vec3_t player_maxs;
void void
PM_InitBoxHull (void) PM_InitBoxHull (void)
{ {
int i; int side, i;
int side;
box_hull.clipnodes = box_clipnodes; box_hull.clipnodes = box_clipnodes;
box_hull.planes = box_planes; box_hull.planes = box_planes;
@ -84,7 +85,6 @@ PM_InitBoxHull (void)
} }
/* /*
PM_HullForBox PM_HullForBox
@ -104,15 +104,11 @@ PM_HullForBox (vec3_t mins, vec3_t maxs)
return &box_hull; return &box_hull;
} }
/*
PM_HullPointContents
*/
int int
PM_HullPointContents (hull_t *hull, int num, vec3_t p) PM_HullPointContents (hull_t *hull, int num, vec3_t p)
{ {
float d;
dclipnode_t *node; dclipnode_t *node;
float d;
mplane_t *plane; mplane_t *plane;
while (num >= 0) { while (num >= 0) {
@ -132,17 +128,14 @@ PM_HullPointContents (hull_t *hull, int num, vec3_t p)
return num; return num;
} }
/*
PM_PointContents
*/
int int
PM_PointContents (vec3_t p) PM_PointContents (vec3_t p)
{ {
float d;
dclipnode_t *node; dclipnode_t *node;
mplane_t *plane; float d;
hull_t *hull; hull_t *hull;
int num; int num;
mplane_t *plane;
hull = &pmove.physents[0].model->hulls[0]; hull = &pmove.physents[0].model->hulls[0];
@ -165,28 +158,20 @@ PM_PointContents (vec3_t p)
return num; return num;
} }
/* /* LINE TESTING IN HULLS */
LINE TESTING IN HULLS
*/
// 1/32 epsilon to keep floating point happy // 1/32 epsilon to keep floating point happy
#define DIST_EPSILON (0.03125) #define DIST_EPSILON (0.03125)
/*
PM_RecursiveHullCheck
*/
qboolean qboolean
PM_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec3_t p1, PM_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec3_t p1,
vec3_t p2, pmtrace_t *trace) vec3_t p2, pmtrace_t *trace)
{ {
dclipnode_t *node; dclipnode_t *node;
float frac, midf, t1, t2;
int side, i;
mplane_t *plane; mplane_t *plane;
float t1, t2;
float frac;
int i;
vec3_t mid; vec3_t mid;
int side;
float midf;
loc0: loc0:
// check for empty // check for empty
@ -251,8 +236,8 @@ PM_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec3_t p1,
if (PM_HullPointContents (hull, node->children[side ^ 1], if (PM_HullPointContents (hull, node->children[side ^ 1],
mid) != CONTENTS_SOLID) { mid) != CONTENTS_SOLID) {
// go past the node // go past the node
return PM_RecursiveHullCheck (hull, node->children[side ^ 1], midf, p2f, return PM_RecursiveHullCheck (hull, node->children[side ^ 1], midf,
mid, p2, trace); p2f, mid, p2, trace);
} }
if (trace->allsolid) if (trace->allsolid)
@ -293,7 +278,6 @@ PM_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec3_t p1,
return false; return false;
} }
/* /*
PM_TestPlayerPosition PM_TestPlayerPosition
@ -302,10 +286,10 @@ PM_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec3_t p1,
qboolean qboolean
PM_TestPlayerPosition (vec3_t pos) PM_TestPlayerPosition (vec3_t pos)
{ {
hull_t *hull;
int i; int i;
physent_t *pe; physent_t *pe;
vec3_t mins, maxs, test; vec3_t mins, maxs, test;
hull_t *hull;
for (i = 0; i < pmove.numphysent; i++) { for (i = 0; i < pmove.numphysent; i++) {
pe = &pmove.physents[i]; pe = &pmove.physents[i];
@ -327,19 +311,15 @@ PM_TestPlayerPosition (vec3_t pos)
return true; return true;
} }
/* /* PM_PlayerMove */
PM_PlayerMove
*/
pmtrace_t pmtrace_t
PM_PlayerMove (vec3_t start, vec3_t end) PM_PlayerMove (vec3_t start, vec3_t end)
{ {
pmtrace_t trace, total;
vec3_t offset;
vec3_t start_l, end_l;
hull_t *hull; hull_t *hull;
int i; int i;
physent_t *pe; physent_t *pe;
vec3_t mins, maxs; pmtrace_t trace, total;
vec3_t maxs, mins, offset, start_l, end_l;
// fill in a default trace // fill in a default trace
memset (&total, 0, sizeof (pmtrace_t)); memset (&total, 0, sizeof (pmtrace_t));

View file

@ -39,7 +39,6 @@
#include <stdlib.h> #include <stdlib.h>
#include "QF/cmd.h" #include "QF/cmd.h"
#include "compat.h"
#include "QF/cvar.h" #include "QF/cvar.h"
#include "QF/draw.h" #include "QF/draw.h"
#include "QF/msg.h" #include "QF/msg.h"
@ -50,6 +49,7 @@
#include "bothdefs.h" #include "bothdefs.h"
#include "cl_cam.h" #include "cl_cam.h"
#include "client.h" #include "client.h"
#include "compat.h"
#include "sbar.h" #include "sbar.h"
int sb_updates; // if >= vid.numpages, no update needed int sb_updates; // if >= vid.numpages, no update needed
@ -88,6 +88,7 @@ static qboolean largegame = false;
cvar_t *cl_showscoresuid; cvar_t *cl_showscoresuid;
/* /*
Sbar_ShowTeamScores Sbar_ShowTeamScores
@ -103,7 +104,6 @@ Sbar_ShowTeamScores (void)
sb_updates = 0; sb_updates = 0;
} }
/* /*
Sbar_DontShowTeamScores Sbar_DontShowTeamScores
@ -116,7 +116,6 @@ Sbar_DontShowTeamScores (void)
sb_updates = 0; sb_updates = 0;
} }
/* /*
Sbar_ShowScores Sbar_ShowScores
@ -132,7 +131,6 @@ Sbar_ShowScores (void)
sb_updates = 0; sb_updates = 0;
} }
/* /*
Sbar_DontShowScores Sbar_DontShowScores
@ -145,14 +143,12 @@ Sbar_DontShowScores (void)
sb_updates = 0; sb_updates = 0;
} }
void void
Sbar_Changed (void) Sbar_Changed (void)
{ {
sb_updates = 0; // update next frame sb_updates = 0; // update next frame
} }
void void
Sbar_Init (void) Sbar_Init (void)
{ {
@ -249,7 +245,6 @@ Sbar_Init (void)
"show uid instead of ping on scores"); "show uid instead of ping on scores");
} }
// drawing routines are reletive to the status bar location // drawing routines are reletive to the status bar location
void void
Sbar_DrawPic (int x, int y, qpic_t *pic) Sbar_DrawPic (int x, int y, qpic_t *pic)
@ -257,7 +252,6 @@ Sbar_DrawPic (int x, int y, qpic_t *pic)
Draw_Pic (x, y + (vid.height - SBAR_HEIGHT), pic); Draw_Pic (x, y + (vid.height - SBAR_HEIGHT), pic);
} }
/* /*
Sbar_DrawSubPic Sbar_DrawSubPic
@ -271,7 +265,6 @@ Sbar_DrawSubPic (int x, int y, qpic_t *pic, int srcx, int srcy, int width,
height); height);
} }
void void
Sbar_DrawTransPic (int x, int y, qpic_t *pic) Sbar_DrawTransPic (int x, int y, qpic_t *pic)
{ {
@ -279,7 +272,6 @@ Sbar_DrawTransPic (int x, int y, qpic_t *pic)
pic); pic);
} }
/* /*
Sbar_DrawCharacter Sbar_DrawCharacter
@ -291,20 +283,17 @@ Sbar_DrawCharacter (int x, int y, int num)
Draw_Character (x + 4, y + vid.height - SBAR_HEIGHT, num); Draw_Character (x + 4, y + vid.height - SBAR_HEIGHT, num);
} }
void void
Sbar_DrawString (int x, int y, char *str) Sbar_DrawString (int x, int y, char *str)
{ {
Draw_String (x, y + vid.height - SBAR_HEIGHT, str); Draw_String (x, y + vid.height - SBAR_HEIGHT, str);
} }
int int
Sbar_itoa (int num, char *buf) Sbar_itoa (int num, char *buf)
{ {
char *str; char *str;
int pow10; int dig, pow10;
int dig;
str = buf; str = buf;
@ -327,7 +316,6 @@ Sbar_itoa (int num, char *buf)
return str - buf; return str - buf;
} }
void void
Sbar_DrawNum (int x, int y, int num, int digits, int color) Sbar_DrawNum (int x, int y, int num, int digits, int color)
{ {
@ -354,7 +342,6 @@ Sbar_DrawNum (int x, int y, int num, int digits, int color)
} }
} }
//ZOID: this should be MAX_CLIENTS, not MAX_SCOREBOARD!! //ZOID: this should be MAX_CLIENTS, not MAX_SCOREBOARD!!
//int fragsort[MAX_SCOREBOARD]; //int fragsort[MAX_SCOREBOARD];
int fragsort[MAX_CLIENTS]; int fragsort[MAX_CLIENTS];
@ -365,11 +352,11 @@ typedef struct {
int players; int players;
int plow, phigh, ptotal; int plow, phigh, ptotal;
} team_t; } team_t;
team_t teams[MAX_CLIENTS]; team_t teams[MAX_CLIENTS];
int teamsort[MAX_CLIENTS]; int teamsort[MAX_CLIENTS];
int scoreboardteams; int scoreboardteams;
void void
Sbar_SortFrags (qboolean includespec) Sbar_SortFrags (qboolean includespec)
{ {
@ -396,14 +383,12 @@ Sbar_SortFrags (qboolean includespec)
} }
} }
void void
Sbar_SortTeams (void) Sbar_SortTeams (void)
{ {
int i, j, k;
player_info_t *s;
int teamplay;
char t[16 + 1]; char t[16 + 1];
int teamplay, i, j, k;
player_info_t *s;
// request new ping times every two second // request new ping times every two second
scoreboardteams = 0; scoreboardteams = 0;
@ -463,14 +448,12 @@ Sbar_SortTeams (void)
} }
} }
int int
Sbar_ColorForMap (int m) Sbar_ColorForMap (int m)
{ {
return (bound (0, m, 13) * 16) + 8; return (bound (0, m, 13) * 16) + 8;
} }
void void
Sbar_SoloScoreboard (void) Sbar_SoloScoreboard (void)
{ {
@ -488,16 +471,13 @@ Sbar_SoloScoreboard (void)
Sbar_DrawString (184, 4, str); Sbar_DrawString (184, 4, str);
} }
void void
Sbar_DrawInventory (void) Sbar_DrawInventory (void)
{ {
int i;
char num[6]; char num[6];
float time; float time;
int flashon; int flashon, i;
qboolean headsup; qboolean headsup, hudswap;
qboolean hudswap;
headsup = !(cl_sbar->int_val || scr_viewsize->int_val < 100); headsup = !(cl_sbar->int_val || scr_viewsize->int_val < 100);
hudswap = cl_hudswap->int_val; hudswap = cl_hudswap->int_val;
@ -522,8 +502,8 @@ Sbar_DrawInventory (void)
if (headsup) { if (headsup) {
if (i || vid.height > 200) if (i || vid.height > 200)
Sbar_DrawSubPic ((hudswap) ? 0 : (vid.width - 24), Sbar_DrawSubPic ((hudswap) ? 0 : (vid.width - 24),
-68 - (7 - i) * 16, sb_weapons[flashon][i], -68 - (7 - i) * 16,
0, 0, 24, 16); sb_weapons[flashon][i], 0, 0, 24, 16);
} else } else
Sbar_DrawPic (i * 24, -16, sb_weapons[flashon][i]); Sbar_DrawPic (i * 24, -16, sb_weapons[flashon][i]);
@ -536,7 +516,8 @@ Sbar_DrawInventory (void)
// ammo counts // ammo counts
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
snprintf (num, sizeof (num), "%3i", min (cl.stats[STAT_SHELLS + i], 999)); snprintf (num, sizeof (num), "%3i", min (cl.stats[STAT_SHELLS + i],
999));
if (headsup) { if (headsup) {
#define HUD_X(dist) ((hudswap) ? dist : (vid.width - (42 - dist))) #define HUD_X(dist) ((hudswap) ? dist : (vid.width - (42 - dist)))
#define HUD_Y(n) (-24 - (4 - n) * 11) #define HUD_Y(n) (-24 - (4 - n) * 11)
@ -587,7 +568,6 @@ Sbar_DrawInventory (void)
} }
} }
void void
Sbar_DrawFrags (void) Sbar_DrawFrags (void)
{ {
@ -642,7 +622,6 @@ Sbar_DrawFrags (void)
} }
} }
void void
Sbar_DrawFace (void) Sbar_DrawFace (void)
{ {
@ -679,7 +658,6 @@ Sbar_DrawFace (void)
Sbar_DrawPic (112, 0, sb_faces[f][anim]); Sbar_DrawPic (112, 0, sb_faces[f][anim]);
} }
void void
Sbar_DrawNormal (void) Sbar_DrawNormal (void)
{ {
@ -720,12 +698,11 @@ Sbar_DrawNormal (void)
Sbar_DrawNum (248, 0, cl.stats[STAT_AMMO], 3, cl.stats[STAT_AMMO] <= 10); Sbar_DrawNum (248, 0, cl.stats[STAT_AMMO], 3, cl.stats[STAT_AMMO] <= 10);
} }
void void
Sbar_Draw (int swap) Sbar_Draw (int swap)
{ {
qboolean headsup;
char st[512]; char st[512];
qboolean headsup;
headsup = !(cl_sbar->int_val || scr_viewsize->int_val < 100); headsup = !(cl_sbar->int_val || scr_viewsize->int_val < 100);
if ((sb_updates >= vid.numpages) && !headsup) if ((sb_updates >= vid.numpages) && !headsup)
@ -791,7 +768,6 @@ Sbar_Draw (int swap)
Sbar_MiniDeathmatchOverlay (); Sbar_MiniDeathmatchOverlay ();
} }
void void
Sbar_IntermissionNumber (int x, int y, int num, int digits, int color) Sbar_IntermissionNumber (int x, int y, int num, int digits, int color)
{ {
@ -818,7 +794,6 @@ Sbar_IntermissionNumber (int x, int y, int num, int digits, int color)
} }
} }
/* /*
Sbar_TeamOverlay Sbar_TeamOverlay
@ -828,14 +803,10 @@ Sbar_IntermissionNumber (int x, int y, int num, int digits, int color)
void void
Sbar_TeamOverlay (void) Sbar_TeamOverlay (void)
{ {
char num[12], team[5];
int pavg, plow, phigh, teamplay, i, k, l, x, y;
qpic_t *pic; qpic_t *pic;
int i, k, l;
int x, y;
char num[12];
int teamplay;
char team[5];
team_t *tm; team_t *tm;
int plow, phigh, pavg;
// request new ping times every two second // request new ping times every two second
teamplay = atoi (Info_ValueForKey (cl.serverinfo, "teamplay")); teamplay = atoi (Info_ValueForKey (cl.serverinfo, "teamplay"));
@ -913,7 +884,6 @@ Sbar_TeamOverlay (void)
Sbar_DeathmatchOverlay (y); Sbar_DeathmatchOverlay (y);
} }
/* /*
Sbar_DeathmatchOverlay Sbar_DeathmatchOverlay
@ -922,18 +892,11 @@ Sbar_TeamOverlay (void)
void void
Sbar_DeathmatchOverlay (int start) Sbar_DeathmatchOverlay (int start)
{ {
qpic_t *pic; char num[12], team[5];
int i, k, l; int minutes, teamplay, total, top, bottom, f, i, k, l, p, x, y;
int top, bottom;
int x, y, f;
char num[12];
player_info_t *s;
int total;
int minutes;
int p;
int teamplay;
char team[5];
int skip = 10; int skip = 10;
player_info_t *s;
qpic_t *pic;
if (largegame) if (largegame)
skip = 8; skip = 8;
@ -1080,7 +1043,6 @@ Sbar_DeathmatchOverlay (int start)
largegame = true; largegame = true;
} }
/* /*
Sbar_MiniDeathmatchOverlay Sbar_MiniDeathmatchOverlay
@ -1091,15 +1053,9 @@ Sbar_DeathmatchOverlay (int start)
void void
Sbar_MiniDeathmatchOverlay (void) Sbar_MiniDeathmatchOverlay (void)
{ {
int i, k; int numlines, teamplay, top, bottom, f, i, k, x, y;
int top, bottom; char name[16 + 1], num[12], team[5];
int x, y, f;
char num[12];
player_info_t *s; player_info_t *s;
int teamplay;
char team[5];
int numlines;
char name[16 + 1];
team_t *tm; team_t *tm;
if (vid.width < 512 || !sb_lines) if (vid.width < 512 || !sb_lines)
@ -1222,7 +1178,6 @@ Sbar_MiniDeathmatchOverlay (void)
} }
void void
Sbar_IntermissionOverlay (void) Sbar_IntermissionOverlay (void)
{ {
@ -1235,7 +1190,6 @@ Sbar_IntermissionOverlay (void)
Sbar_DeathmatchOverlay (0); Sbar_DeathmatchOverlay (0);
} }
void void
Sbar_FinaleOverlay (void) Sbar_FinaleOverlay (void)
{ {

View file

@ -36,7 +36,6 @@
# include <strings.h> # include <strings.h>
#endif #endif
#include "compat.h"
#include "QF/console.h" #include "QF/console.h"
#include "QF/cvar.h" #include "QF/cvar.h"
#include "QF/hash.h" #include "QF/hash.h"
@ -47,6 +46,7 @@
#include "QF/vfs.h" #include "QF/vfs.h"
#include "client.h" #include "client.h"
#include "compat.h"
#define MAX_TEMP_SKINS 64 //XXX dynamic? #define MAX_TEMP_SKINS 64 //XXX dynamic?

View file

@ -38,7 +38,6 @@
#include <errno.h> #include <errno.h>
#include "compat.h"
#include "QF/console.h" #include "QF/console.h"
#include "QF/cmd.h" #include "QF/cmd.h"
#include "QF/cvar.h" #include "QF/cvar.h"
@ -49,19 +48,24 @@
#include "bothdefs.h" #include "bothdefs.h"
#include "client.h" #include "client.h"
#include "compat.h"
static qboolean died = false, recorded_location = false;
static vec3_t death_location, last_recorded_location;
extern cvar_t *skin;
cvar_t *cl_deadbodyfilter; cvar_t *cl_deadbodyfilter;
cvar_t *cl_gibfilter; cvar_t *cl_gibfilter;
cvar_t *cl_parsesay; cvar_t *cl_parsesay;
cvar_t *cl_nofake; cvar_t *cl_nofake;
static qboolean died = false, recorded_location = false;
static vec3_t death_location, last_recorded_location; extern cvar_t *skin;
void void
Team_BestWeaponImpulse (void) Team_BestWeaponImpulse (void)
{ {
int best, i, imp, items; int best, i, imp, items;
extern int in_impulse; extern int in_impulse;
items = cl.stats[STAT_ITEMS]; items = cl.stats[STAT_ITEMS];
@ -104,7 +108,6 @@ Team_BestWeaponImpulse (void)
case 8: case 8:
if (items & IT_LIGHTNING && cl.stats[STAT_CELLS] >= 1) if (items & IT_LIGHTNING && cl.stats[STAT_CELLS] >= 1)
best = 8; best = 8;
} }
} }
@ -116,10 +119,10 @@ Team_BestWeaponImpulse (void)
const char * const char *
Team_ParseSay (const char *s) Team_ParseSay (const char *s)
{ {
static char buf[1024];
int i, bracket;
char c, chr, t2[128], t3[128]; char c, chr, t2[128], t3[128];
const char *t1; const char *t1;
static char buf[1024];
int i, bracket;
static location_t *location = NULL; static location_t *location = NULL;
if (!cl_parsesay->int_val) if (!cl_parsesay->int_val)
@ -335,30 +338,34 @@ Team_NewMap (void)
void void
Team_Init_Cvars (void) Team_Init_Cvars (void)
{ {
cl_deadbodyfilter = cl_deadbodyfilter = Cvar_Get ("cl_deadbodyfilter", "0", CVAR_NONE, NULL,
Cvar_Get ("cl_deadbodyfilter", "0", CVAR_NONE, NULL,
"Hide dead player models"); "Hide dead player models");
cl_gibfilter = Cvar_Get ("cl_gibfilter", "0", CVAR_NONE, NULL, "Hide gibs"); cl_gibfilter = Cvar_Get ("cl_gibfilter", "0", CVAR_NONE, NULL,
"Hide gibs");
cl_parsesay = Cvar_Get ("cl_parsesay", "0", CVAR_NONE, NULL, cl_parsesay = Cvar_Get ("cl_parsesay", "0", CVAR_NONE, NULL,
"Use .loc files to find your present location when you put %l in messages"); "Use .loc files to find your present location "
"when you put %l in messages");
cl_nofake = Cvar_Get ("cl_nofake", "0", CVAR_NONE, NULL, cl_nofake = Cvar_Get ("cl_nofake", "0", CVAR_NONE, NULL,
"Unhide fake messages"); "Unhide fake messages");
} }
/* /*
locs_loc locs_loc
Location marker manipulation Location marker manipulation
*/ */
void void
locs_loc (void) locs_loc (void)
{ {
char locfile[MAX_OSPATH];
char *mapname; char *mapname;
const char *desc = NULL; const char *desc = NULL;
char locfile[MAX_OSPATH];
//FIXME checking needed to make sure you are actually in the game and a live. // FIXME: need to check to ensure you are actually in the game and alive.
if (Cmd_Argc () == 1) { if (Cmd_Argc () == 1) {
Con_Printf ("loc <add|delete|rename|move|save|zsave> [<description>] :Modifies location data, add|rename take <description> parameter\n"); Con_Printf ("loc <add|delete|rename|move|save|zsave> [<description>] "
":Modifies location data, add|rename take <description> "
"parameter\n");
return; return;
} }
if (Cmd_Argc () >= 3) if (Cmd_Argc () >= 3)
@ -388,14 +395,17 @@ locs_loc (void)
if (Cmd_Argc () >= 3) if (Cmd_Argc () >= 3)
locs_mark(cl.simorg,desc); locs_mark(cl.simorg,desc);
else else
Con_Printf("loc add <description> :marks the current location with the description and records the information into a loc file.\n"); Con_Printf ("loc add <description> :marks the current location "
"with the description and records the information "
"into a loc file.\n");
} }
if (strcasecmp(Cmd_Argv(1),"rename") == 0) { if (strcasecmp(Cmd_Argv(1),"rename") == 0) {
if (Cmd_Argc () >= 3) if (Cmd_Argc () >= 3)
locs_edit(cl.simorg,desc); locs_edit(cl.simorg,desc);
else else
Con_Printf("loc rename <description> :changes the description of the nearest location marker\n"); Con_Printf ("loc rename <description> :changes the description of "
"the nearest location marker\n");
} }
if (strcasecmp(Cmd_Argv(1),"delete") == 0) { if (strcasecmp(Cmd_Argv(1),"delete") == 0) {
@ -409,13 +419,14 @@ locs_loc (void)
if (Cmd_Argc () == 2) if (Cmd_Argc () == 2)
locs_edit(cl.simorg,NULL); locs_edit(cl.simorg,NULL);
else else
Con_Printf("loc move :moves the nearest location marker to your current location\n"); Con_Printf ("loc move :moves the nearest location marker to your "
"current location\n");
} }
} }
void void
Locs_Init (void) Locs_Init (void)
{ {
Cmd_AddCommand ("loc", locs_loc, "Location marker editing commands: 'loc help' for more"); Cmd_AddCommand ("loc", locs_loc, "Location marker editing commands: 'loc "
"help' for more");
} }

View file

@ -65,9 +65,7 @@ typedef struct {
int SV_HullPointContents (hull_t *hull, int num, vec3_t p); int SV_HullPointContents (hull_t *hull, int num, vec3_t p);
/* /* HULL BOXES */
HULL BOXES
*/
static hull_t box_hull; static hull_t box_hull;
static dclipnode_t box_clipnodes[6]; static dclipnode_t box_clipnodes[6];
@ -83,8 +81,7 @@ static mplane_t box_planes[6];
void void
SV_InitHull (hull_t *hull, dclipnode_t *clipnodes, mplane_t *planes) SV_InitHull (hull_t *hull, dclipnode_t *clipnodes, mplane_t *planes)
{ {
int i; int side, i;
int side;
hull->clipnodes = clipnodes; hull->clipnodes = clipnodes;
hull->planes = planes; hull->planes = planes;
@ -113,7 +110,6 @@ SV_InitBoxHull (void)
SV_InitHull (&box_hull, box_clipnodes, box_planes); SV_InitHull (&box_hull, box_clipnodes, box_planes);
} }
/* /*
SV_HullForBox SV_HullForBox
@ -133,7 +129,6 @@ SV_HullForBox (vec3_t mins, vec3_t maxs)
return &box_hull; return &box_hull;
} }
/* /*
SV_HullForEntity SV_HullForEntity
@ -145,11 +140,10 @@ SV_HullForBox (vec3_t mins, vec3_t maxs)
hull_t * hull_t *
SV_HullForEntity (edict_t *ent, vec3_t mins, vec3_t maxs, vec3_t offset) SV_HullForEntity (edict_t *ent, vec3_t mins, vec3_t maxs, vec3_t offset)
{ {
model_t *model;
vec3_t size;
vec3_t hullmins, hullmaxs;
hull_t *hull = 0; hull_t *hull = 0;
int hull_index = 0; int hull_index = 0;
model_t *model;
vec3_t hullmins, hullmaxs, size;
if ((sv_fields.rotated_bbox != -1 if ((sv_fields.rotated_bbox != -1
&& SVinteger (ent, rotated_bbox)) && SVinteger (ent, rotated_bbox))
@ -196,21 +190,16 @@ SV_HullForEntity (edict_t *ent, vec3_t mins, vec3_t maxs, vec3_t offset)
return hull; return hull;
} }
/* ENTITY AREA CHECKING */
/*
ENTITY AREA CHECKING
*/
areanode_t sv_areanodes[AREA_NODES]; areanode_t sv_areanodes[AREA_NODES];
int sv_numareanodes; int sv_numareanodes;
areanode_t * areanode_t *
SV_CreateAreaNode (int depth, vec3_t mins, vec3_t maxs) SV_CreateAreaNode (int depth, vec3_t mins, vec3_t maxs)
{ {
areanode_t *anode; areanode_t *anode;
vec3_t size; vec3_t mins1, maxs1, mins2, maxs2, size;
vec3_t mins1, maxs1, mins2, maxs2;
anode = &sv_areanodes[sv_numareanodes]; anode = &sv_areanodes[sv_numareanodes];
sv_numareanodes++; sv_numareanodes++;
@ -244,7 +233,6 @@ SV_CreateAreaNode (int depth, vec3_t mins, vec3_t maxs)
return anode; return anode;
} }
void void
SV_ClearWorld (void) SV_ClearWorld (void)
{ {
@ -269,9 +257,9 @@ SV_UnlinkEdict (edict_t *ent)
void void
SV_TouchLinks (edict_t *ent, areanode_t *node) SV_TouchLinks (edict_t *ent, areanode_t *node)
{ {
link_t *l, *next;
edict_t *touch; edict_t *touch;
int old_self, old_other; int old_self, old_other;
link_t *l, *next;
// touch linked edicts // touch linked edicts
for (l = node->trigger_edicts.next; l != &node->trigger_edicts; l = next) { for (l = node->trigger_edicts.next; l != &node->trigger_edicts; l = next) {
@ -316,10 +304,9 @@ SV_TouchLinks (edict_t *ent, areanode_t *node)
void void
SV_FindTouchedLeafs (edict_t *ent, mnode_t *node) SV_FindTouchedLeafs (edict_t *ent, mnode_t *node)
{ {
mplane_t *splitplane; int leafnum, sides;
mleaf_t *leaf; mleaf_t *leaf;
int sides; mplane_t *splitplane;
int leafnum;
if (node->contents == CONTENTS_SOLID) if (node->contents == CONTENTS_SOLID)
return; return;
@ -350,7 +337,6 @@ SV_FindTouchedLeafs (edict_t *ent, mnode_t *node)
SV_FindTouchedLeafs (ent, node->children[1]); SV_FindTouchedLeafs (ent, node->children[1]);
} }
void void
SV_LinkEdict (edict_t *ent, qboolean touch_triggers) SV_LinkEdict (edict_t *ent, qboolean touch_triggers)
{ {
@ -420,18 +406,14 @@ SV_LinkEdict (edict_t *ent, qboolean touch_triggers)
SV_TouchLinks (ent, sv_areanodes); SV_TouchLinks (ent, sv_areanodes);
} }
/* POINT TESTING IN HULLS */
/*
POINT TESTING IN HULLS
*/
#ifndef USE_INTEL_ASM #ifndef USE_INTEL_ASM
int int
SV_HullPointContents (hull_t *hull, int num, vec3_t p) SV_HullPointContents (hull_t *hull, int num, vec3_t p)
{ {
float d;
dclipnode_t *node; dclipnode_t *node;
float d;
mplane_t *plane; mplane_t *plane;
while (num >= 0) { while (num >= 0) {
@ -455,7 +437,6 @@ SV_HullPointContents (hull_t *hull, int num, vec3_t p)
} }
#endif // !USE_INTEL_ASM #endif // !USE_INTEL_ASM
int int
SV_PointContents (vec3_t p) SV_PointContents (vec3_t p)
{ {
@ -467,14 +448,12 @@ SV_PointContents (vec3_t p)
return cont; return cont;
} }
int int
SV_TruePointContents (vec3_t p) SV_TruePointContents (vec3_t p)
{ {
return SV_HullPointContents (&sv.worldmodel->hulls[0], 0, p); return SV_HullPointContents (&sv.worldmodel->hulls[0], 0, p);
} }
/* /*
SV_TestEntityPosition SV_TestEntityPosition
@ -498,27 +477,20 @@ SV_TestEntityPosition (edict_t *ent)
return NULL; return NULL;
} }
/* LINE TESTING IN HULLS */
/*
LINE TESTING IN HULLS
*/
// 1/32 epsilon to keep floating point happy // 1/32 epsilon to keep floating point happy
#define DIST_EPSILON (0.03125) #define DIST_EPSILON (0.03125)
qboolean qboolean
SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec3_t p1, SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec3_t p1,
vec3_t p2, trace_t *trace) vec3_t p2, trace_t *trace)
{ {
dclipnode_t *node; dclipnode_t *node;
float frac, midf, t1, t2;
int side, i;
mplane_t *plane; mplane_t *plane;
float t1, t2;
float frac;
int i;
vec3_t mid; vec3_t mid;
int side;
float midf;
// check for empty // check for empty
if (num < 0) { if (num < 0) {
@ -631,7 +603,6 @@ SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec3_t p1,
return false; return false;
} }
/* /*
SV_ClipMoveToEntity SV_ClipMoveToEntity
@ -642,10 +613,9 @@ trace_t
SV_ClipMoveToEntity (edict_t *touched, edict_t *mover, vec3_t start, SV_ClipMoveToEntity (edict_t *touched, edict_t *mover, vec3_t start,
vec3_t mins, vec3_t maxs, vec3_t end) vec3_t mins, vec3_t maxs, vec3_t end)
{ {
trace_t trace;
vec3_t offset;
vec3_t start_l, end_l;
hull_t *hull; hull_t *hull;
trace_t trace;
vec3_t offset, start_l, end_l;
// fill in a default trace // fill in a default trace
memset (&trace, 0, sizeof (trace_t)); memset (&trace, 0, sizeof (trace_t));
@ -675,7 +645,6 @@ SV_ClipMoveToEntity (edict_t *touched, edict_t *mover, vec3_t start,
return trace; return trace;
} }
/* /*
SV_ClipToLinks SV_ClipToLinks
@ -684,8 +653,8 @@ SV_ClipMoveToEntity (edict_t *touched, edict_t *mover, vec3_t start,
void void
SV_ClipToLinks (areanode_t *node, moveclip_t * clip) SV_ClipToLinks (areanode_t *node, moveclip_t * clip)
{ {
link_t *l, *next;
edict_t *touch; edict_t *touch;
link_t *l, *next;
trace_t trace; trace_t trace;
// touch linked edicts // touch linked edicts
@ -755,7 +724,6 @@ SV_ClipToLinks (areanode_t *node, moveclip_t * clip)
SV_ClipToLinks (node->children[1], clip); SV_ClipToLinks (node->children[1], clip);
} }
void void
SV_MoveBounds (vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, SV_MoveBounds (vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end,
vec3_t boxmins, vec3_t boxmaxs) vec3_t boxmins, vec3_t boxmaxs)
@ -779,13 +747,12 @@ SV_MoveBounds (vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end,
#endif #endif
} }
trace_t trace_t
SV_Move (vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, int type, SV_Move (vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, int type,
edict_t *passedict) edict_t *passedict)
{ {
moveclip_t clip;
int i; int i;
moveclip_t clip;
memset (&clip, 0, sizeof (moveclip_t)); memset (&clip, 0, sizeof (moveclip_t));
@ -823,11 +790,10 @@ SV_Move (vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, int type,
edict_t * edict_t *
SV_TestPlayerPosition (edict_t *ent, vec3_t origin) SV_TestPlayerPosition (edict_t *ent, vec3_t origin)
{ {
hull_t *hull;
edict_t *check; edict_t *check;
vec3_t boxmins, boxmaxs; hull_t *hull;
vec3_t offset;
int e; int e;
vec3_t boxmins, boxmaxs, offset;
// check world first // check world first
hull = &sv.worldmodel->hulls[1]; hull = &sv.worldmodel->hulls[1];
@ -839,7 +805,8 @@ SV_TestPlayerPosition (edict_t *ent, vec3_t origin)
VectorAdd (origin, SVvector (ent, maxs), boxmaxs); VectorAdd (origin, SVvector (ent, maxs), boxmaxs);
check = NEXT_EDICT (&sv_pr_state, sv.edicts); check = NEXT_EDICT (&sv_pr_state, sv.edicts);
for (e = 1; e < sv.num_edicts; e++, check = NEXT_EDICT (&sv_pr_state, check)) { for (e = 1; e < sv.num_edicts; e++, check = NEXT_EDICT (&sv_pr_state,
check)) {
if (check->free) if (check->free)
continue; continue;
if (check == ent) if (check == ent)