More diff noise reductions. yay!

This commit is contained in:
Adam Olsen 2001-07-15 01:48:03 +00:00
parent ac46e5b49d
commit 155b46b8c8
12 changed files with 229 additions and 324 deletions

View file

@ -80,7 +80,7 @@ COM_Init (void)
registered = Cvar_Get ("registered", "0", CVAR_NONE, NULL, registered = Cvar_Get ("registered", "0", CVAR_NONE, NULL,
"Is the game the registered version. 1 yes 0 no"); "Is the game the registered version. 1 yes 0 no");
cmdline = Cvar_Get ("cmdline", "0", CVAR_SERVERINFO, Cvar_Info, "None"); cmdline = Cvar_Get ("cmdline", "0", CVAR_SERVERINFO, Cvar_Info, "None");
Cmd_AddCommand ("path", COM_Path_f, "No Description"); Cmd_AddCommand ("path", COM_Path_f, "Show what paths Quake is using");
COM_Filesystem_Init_Cvars (); COM_Filesystem_Init_Cvars ();
COM_Filesystem_Init (); COM_Filesystem_Init ();

View file

@ -37,13 +37,10 @@
#define STEPSIZE 18 #define STEPSIZE 18
/* /*
============= SV_CheckBottom
SV_CheckBottom
Returns false if any part of the bottom of the entity is off an edge that Returns false if any part of the bottom of the entity is off an edge that
is not a staircase. is not a staircase.
=============
*/ */
int c_yes, c_no; int c_yes, c_no;
@ -110,14 +107,12 @@ SV_CheckBottom (edict_t *ent)
/* /*
============= SV_movestep
SV_movestep
Called by monster program code. Called by monster program code.
The move will be adjusted for slopes and stairs, but if the move isn't The move will be adjusted for slopes and stairs, but if the move isn't
possible, no move is done, false is returned, and possible, no move is done, false is returned, and
pr_global_struct->trace_normal is set to the normal of the blocking wall pr_global_struct->trace_normal is set to the normal of the blocking wall
=============
*/ */
qboolean qboolean
SV_movestep (edict_t *ent, vec3_t move, qboolean relink) SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
@ -147,8 +142,7 @@ SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
neworg[2] += 8; neworg[2] += 8;
} }
trace = trace =
SV_Move (SVFIELD (ent, origin, vector), SVFIELD (ent, mins, vector), SVFIELD (ent, maxs, vector), neworg, SV_Move (SVFIELD (ent, origin, vector), SVFIELD (ent, mins, vector), SVFIELD (ent, maxs, vector), neworg, false, ent);
false, ent);
if (trace.fraction == 1) { if (trace.fraction == 1) {
if (((int) SVFIELD (ent, flags, float) & FL_SWIM) if (((int) SVFIELD (ent, flags, float) & FL_SWIM)
@ -228,13 +222,10 @@ SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
//============================================================================ //============================================================================
/* /*
====================== SV_StepDirection
SV_StepDirection
Turns to the movement direction, and walks the current distance if Turns to the movement direction, and walks the current distance if
facing it. facing it.
======================
*/ */
qboolean qboolean
SV_StepDirection (edict_t *ent, float yaw, float dist) SV_StepDirection (edict_t *ent, float yaw, float dist)
@ -266,10 +257,7 @@ SV_StepDirection (edict_t *ent, float yaw, float dist)
} }
/* /*
====================== SV_FixCheckBottom
SV_FixCheckBottom
======================
*/ */
void void
SV_FixCheckBottom (edict_t *ent) SV_FixCheckBottom (edict_t *ent)
@ -282,10 +270,7 @@ SV_FixCheckBottom (edict_t *ent)
/* /*
================ SV_NewChaseDir
SV_NewChaseDir
================
*/ */
#define DI_NODIR -1 #define DI_NODIR -1
void void
@ -366,10 +351,7 @@ SV_NewChaseDir (edict_t *actor, edict_t *enemy, float dist)
} }
/* /*
====================== SV_CloseEnough
SV_CloseEnough
======================
*/ */
qboolean qboolean
SV_CloseEnough (edict_t *ent, edict_t *goal, float dist) SV_CloseEnough (edict_t *ent, edict_t *goal, float dist)
@ -386,21 +368,14 @@ SV_CloseEnough (edict_t *ent, edict_t *goal, float dist)
} }
/* /*
====================== SV_MoveToGoal
SV_MoveToGoal
======================
*/ */
void void
SV_MoveToGoal (progs_t * pr) SV_MoveToGoal (progs_t *pr)
{ {
edict_t *ent, *goal; edict_t *ent, *goal;
float dist; float dist;
#ifdef QUAKE2
edict_t *enemy;
#endif
ent = PROG_TO_EDICT (pr, *pr->globals.self); ent = PROG_TO_EDICT (pr, *pr->globals.self);
goal = PROG_TO_EDICT (pr, SVFIELD (ent, goalentity, entity)); goal = PROG_TO_EDICT (pr, SVFIELD (ent, goalentity, entity));
dist = G_FLOAT (pr, OFS_PARM0); dist = G_FLOAT (pr, OFS_PARM0);
@ -410,13 +385,8 @@ SV_MoveToGoal (progs_t * pr)
return; return;
} }
// if the next step hits the enemy, return immediately // if the next step hits the enemy, return immediately
#ifdef QUAKE2
enemy = PROG_TO_EDICT (pr->, SVFIELD (ent, enemy, entity));
if (enemy != sv.edicts && SV_CloseEnough (ent, enemy, dist))
#else
if (PROG_TO_EDICT (pr, SVFIELD (ent, enemy, entity)) != sv.edicts if (PROG_TO_EDICT (pr, SVFIELD (ent, enemy, entity)) != sv.edicts
&& SV_CloseEnough (ent, goal, dist)) && SV_CloseEnough (ent, goal, dist))
#endif
return; return;
// bump around... // bump around...

View file

@ -125,7 +125,7 @@ PR_Profile_f (void)
} }
static int static int
parse_field (progs_t * pr, char *key, char *value) parse_field (progs_t *pr, char *key, char *value)
{ {
return 0; return 0;
} }
@ -142,142 +142,137 @@ SV_LoadProgs (void)
sv_globals.self = sv_pr_state.globals.self; sv_globals.self = sv_pr_state.globals.self;
sv_globals.time = sv_pr_state.globals.time; sv_globals.time = sv_pr_state.globals.time;
(void *) sv_globals.self = PR_GetGlobalPointer (&sv_pr_state, "self"); (void *) sv_globals.self = PR_GetGlobalPointer (&sv_pr_state, "self");
(void *) sv_globals.other = PR_GetGlobalPointer (&sv_pr_state, "other"); (void *) sv_globals.other = PR_GetGlobalPointer (&sv_pr_state, "other");
(void *) sv_globals.world = PR_GetGlobalPointer (&sv_pr_state, "world"); (void *) sv_globals.world = PR_GetGlobalPointer (&sv_pr_state, "world");
(void *) sv_globals.time = PR_GetGlobalPointer (&sv_pr_state, "time"); (void *) sv_globals.time = PR_GetGlobalPointer (&sv_pr_state, "time");
(void *) sv_globals.frametime = PR_GetGlobalPointer (&sv_pr_state, "frametime"); (void *) sv_globals.frametime = PR_GetGlobalPointer (&sv_pr_state, "frametime");
(void *) sv_globals.force_retouch = PR_GetGlobalPointer (&sv_pr_state, "force_retouch"); (void *) sv_globals.force_retouch = PR_GetGlobalPointer (&sv_pr_state, "force_retouch");
(void *) sv_globals.mapname = PR_GetGlobalPointer (&sv_pr_state, "mapname"); (void *) sv_globals.mapname = PR_GetGlobalPointer (&sv_pr_state, "mapname");
(void *) sv_globals.deathmatch = PR_GetGlobalPointer (&sv_pr_state, "deathmatch"); (void *) sv_globals.deathmatch = PR_GetGlobalPointer (&sv_pr_state, "deathmatch");
(void *) sv_globals.coop = PR_GetGlobalPointer (&sv_pr_state, "coop"); (void *) sv_globals.coop = PR_GetGlobalPointer (&sv_pr_state, "coop");
(void *) sv_globals.teamplay = PR_GetGlobalPointer (&sv_pr_state, "teamplay"); (void *) sv_globals.teamplay = PR_GetGlobalPointer (&sv_pr_state, "teamplay");
(void *) sv_globals.serverflags = PR_GetGlobalPointer (&sv_pr_state, "serverflags"); (void *) sv_globals.serverflags = PR_GetGlobalPointer (&sv_pr_state, "serverflags");
(void *) sv_globals.total_secrets = PR_GetGlobalPointer (&sv_pr_state, "total_secrets"); (void *) sv_globals.total_secrets = PR_GetGlobalPointer (&sv_pr_state, "total_secrets");
(void *) sv_globals.total_monsters = PR_GetGlobalPointer (&sv_pr_state, "total_monsters"); (void *) sv_globals.total_monsters = PR_GetGlobalPointer (&sv_pr_state, "total_monsters");
(void *) sv_globals.found_secrets = PR_GetGlobalPointer (&sv_pr_state, "found_secrets"); (void *) sv_globals.found_secrets = PR_GetGlobalPointer (&sv_pr_state, "found_secrets");
(void *) sv_globals.killed_monsters = PR_GetGlobalPointer (&sv_pr_state, "killed_monsters"); (void *) sv_globals.killed_monsters = PR_GetGlobalPointer (&sv_pr_state, "killed_monsters");
(void *) sv_globals.parms = PR_GetGlobalPointer (&sv_pr_state, "parm1"); (void *) sv_globals.parms = PR_GetGlobalPointer (&sv_pr_state, "parm1");
(void *) sv_globals.v_forward = PR_GetGlobalPointer (&sv_pr_state, "v_forward"); (void *) sv_globals.v_forward = PR_GetGlobalPointer (&sv_pr_state, "v_forward");
(void *) sv_globals.v_up = PR_GetGlobalPointer (&sv_pr_state, "v_up"); (void *) sv_globals.v_up = PR_GetGlobalPointer (&sv_pr_state, "v_up");
(void *) sv_globals.v_right = PR_GetGlobalPointer (&sv_pr_state, "v_right"); (void *) sv_globals.v_right = PR_GetGlobalPointer (&sv_pr_state, "v_right");
(void *) sv_globals.trace_allsolid = PR_GetGlobalPointer (&sv_pr_state, "trace_allsolid"); (void *) sv_globals.trace_allsolid = PR_GetGlobalPointer (&sv_pr_state, "trace_allsolid");
(void *) sv_globals.trace_startsolid = PR_GetGlobalPointer (&sv_pr_state, "trace_startsolid"); (void *) sv_globals.trace_startsolid = PR_GetGlobalPointer (&sv_pr_state, "trace_startsolid");
(void *) sv_globals.trace_fraction = PR_GetGlobalPointer (&sv_pr_state, "trace_fraction"); (void *) sv_globals.trace_fraction = PR_GetGlobalPointer (&sv_pr_state, "trace_fraction");
(void *) sv_globals.trace_endpos = PR_GetGlobalPointer (&sv_pr_state, "trace_endpos"); (void *) sv_globals.trace_endpos = PR_GetGlobalPointer (&sv_pr_state, "trace_endpos");
(void *) sv_globals.trace_plane_normal = PR_GetGlobalPointer (&sv_pr_state, "trace_plane_normal"); (void *) sv_globals.trace_plane_normal = PR_GetGlobalPointer (&sv_pr_state, "trace_plane_normal");
(void *) sv_globals.trace_plane_dist = PR_GetGlobalPointer (&sv_pr_state, "trace_plane_dist"); (void *) sv_globals.trace_plane_dist = PR_GetGlobalPointer (&sv_pr_state, "trace_plane_dist");
(void *) sv_globals.trace_ent = PR_GetGlobalPointer (&sv_pr_state, "trace_ent"); (void *) sv_globals.trace_ent = PR_GetGlobalPointer (&sv_pr_state, "trace_ent");
(void *) sv_globals.trace_inopen = PR_GetGlobalPointer (&sv_pr_state, "trace_inopen"); (void *) sv_globals.trace_inopen = PR_GetGlobalPointer (&sv_pr_state, "trace_inopen");
(void *) sv_globals.trace_inwater = PR_GetGlobalPointer (&sv_pr_state, "trace_inwater"); (void *) sv_globals.trace_inwater = PR_GetGlobalPointer (&sv_pr_state, "trace_inwater");
(void *) sv_globals.msg_entity = PR_GetGlobalPointer (&sv_pr_state, "msg_entity"); (void *) sv_globals.msg_entity = PR_GetGlobalPointer (&sv_pr_state, "msg_entity");
#ifdef QUAKE2 sv_funcs.main = PR_GetFunctionIndex (&sv_pr_state, "main");
(void *) sv_globals.startspot = PR_GetGlobalPointer (&sv_pr_state, "startspot"); sv_funcs.StartFrame = PR_GetFunctionIndex (&sv_pr_state, "StartFrame");
(void *) sv_globals.null = PR_GetGlobalPointer (&sv_pr_state, "null"); sv_funcs.PlayerPreThink = PR_GetFunctionIndex (&sv_pr_state, "PlayerPreThink");
#endif sv_funcs.PlayerPostThink = PR_GetFunctionIndex (&sv_pr_state, "PlayerPostThink");
sv_funcs.ClientKill = PR_GetFunctionIndex (&sv_pr_state, "ClientKill");
sv_funcs.ClientConnect = PR_GetFunctionIndex (&sv_pr_state, "ClientConnect");
sv_funcs.PutClientInServer = PR_GetFunctionIndex (&sv_pr_state, "PutClientInServer");
sv_funcs.ClientDisconnect = PR_GetFunctionIndex (&sv_pr_state, "ClientDisconnect");
sv_funcs.SetNewParms = PR_GetFunctionIndex (&sv_pr_state, "SetNewParms");
sv_funcs.SetChangeParms = PR_GetFunctionIndex (&sv_pr_state, "SetChangeParms");
sv_funcs.main = PR_GetFunctionIndex (&sv_pr_state, "main"); sv_fields.modelindex = PR_GetFieldOffset (&sv_pr_state, "modelindex");
sv_funcs.StartFrame = PR_GetFunctionIndex (&sv_pr_state, "StartFrame"); sv_fields.absmin = PR_GetFieldOffset (&sv_pr_state, "absmin");
sv_funcs.PlayerPreThink = PR_GetFunctionIndex (&sv_pr_state, "PlayerPreThink"); sv_fields.absmax = PR_GetFieldOffset (&sv_pr_state, "absmax");
sv_funcs.PlayerPostThink = PR_GetFunctionIndex (&sv_pr_state, "PlayerPostThink"); sv_fields.ltime = PR_GetFieldOffset (&sv_pr_state, "ltime");
sv_funcs.ClientKill = PR_GetFunctionIndex (&sv_pr_state, "ClientKill"); sv_fields.movetype = PR_GetFieldOffset (&sv_pr_state, "movetype");
sv_funcs.ClientConnect = PR_GetFunctionIndex (&sv_pr_state, "ClientConnect"); sv_fields.solid = PR_GetFieldOffset (&sv_pr_state, "solid");
sv_funcs.PutClientInServer = PR_GetFunctionIndex (&sv_pr_state, "PutClientInServer"); sv_fields.origin = PR_GetFieldOffset (&sv_pr_state, "origin");
sv_funcs.ClientDisconnect = PR_GetFunctionIndex (&sv_pr_state, "ClientDisconnect"); sv_fields.oldorigin = PR_GetFieldOffset (&sv_pr_state, "oldorigin");
sv_funcs.SetNewParms = PR_GetFunctionIndex (&sv_pr_state, "SetNewParms"); sv_fields.velocity = PR_GetFieldOffset (&sv_pr_state, "velocity");
sv_funcs.SetChangeParms = PR_GetFunctionIndex (&sv_pr_state, "SetChangeParms"); sv_fields.angles = PR_GetFieldOffset (&sv_pr_state, "angles");
sv_fields.avelocity = PR_GetFieldOffset (&sv_pr_state, "avelocity");
sv_fields.modelindex = ED_GetFieldIndex (&sv_pr_state, "modelindex"); sv_fields.basevelocity = PR_GetFieldOffset (&sv_pr_state, "basevelocity");
sv_fields.absmin = ED_GetFieldIndex (&sv_pr_state, "absmin"); sv_fields.punchangle = PR_GetFieldOffset (&sv_pr_state, "punchangle");
sv_fields.absmax = ED_GetFieldIndex (&sv_pr_state, "absmax"); sv_fields.classname = PR_GetFieldOffset (&sv_pr_state, "classname");
sv_fields.ltime = ED_GetFieldIndex (&sv_pr_state, "ltime"); sv_fields.model = PR_GetFieldOffset (&sv_pr_state, "model");
sv_fields.movetype = ED_GetFieldIndex (&sv_pr_state, "movetype"); sv_fields.frame = PR_GetFieldOffset (&sv_pr_state, "frame");
sv_fields.solid = ED_GetFieldIndex (&sv_pr_state, "solid"); sv_fields.skin = PR_GetFieldOffset (&sv_pr_state, "skin");
sv_fields.origin = ED_GetFieldIndex (&sv_pr_state, "origin"); sv_fields.effects = PR_GetFieldOffset (&sv_pr_state, "effects");
sv_fields.oldorigin = ED_GetFieldIndex (&sv_pr_state, "oldorigin"); sv_fields.drawPercent = PR_GetFieldOffset (&sv_pr_state, "drawPercent");
sv_fields.velocity = ED_GetFieldIndex (&sv_pr_state, "velocity"); sv_fields.gravity = PR_GetFieldOffset (&sv_pr_state, "gravity");
sv_fields.angles = ED_GetFieldIndex (&sv_pr_state, "angles"); sv_fields.mass = PR_GetFieldOffset (&sv_pr_state, "mass");
sv_fields.avelocity = ED_GetFieldIndex (&sv_pr_state, "avelocity"); sv_fields.light_level = PR_GetFieldOffset (&sv_pr_state, "light_level");
sv_fields.basevelocity = ED_GetFieldIndex (&sv_pr_state, "basevelocity"); sv_fields.mins = PR_GetFieldOffset (&sv_pr_state, "mins");
sv_fields.punchangle = ED_GetFieldIndex (&sv_pr_state, "punchangle"); sv_fields.maxs = PR_GetFieldOffset (&sv_pr_state, "maxs");
sv_fields.classname = ED_GetFieldIndex (&sv_pr_state, "classname"); sv_fields.size = PR_GetFieldOffset (&sv_pr_state, "size");
sv_fields.model = ED_GetFieldIndex (&sv_pr_state, "model"); sv_fields.touch = PR_GetFieldOffset (&sv_pr_state, "touch");
sv_fields.frame = ED_GetFieldIndex (&sv_pr_state, "frame"); sv_fields.use = PR_GetFieldOffset (&sv_pr_state, "use");
sv_fields.skin = ED_GetFieldIndex (&sv_pr_state, "skin"); sv_fields.think = PR_GetFieldOffset (&sv_pr_state, "think");
sv_fields.effects = ED_GetFieldIndex (&sv_pr_state, "effects"); sv_fields.blocked = PR_GetFieldOffset (&sv_pr_state, "blocked");
sv_fields.drawPercent = ED_GetFieldIndex (&sv_pr_state, "drawPercent"); sv_fields.nextthink = PR_GetFieldOffset (&sv_pr_state, "nextthink");
sv_fields.gravity = ED_GetFieldIndex (&sv_pr_state, "gravity"); sv_fields.groundentity = PR_GetFieldOffset (&sv_pr_state, "groundentity");
sv_fields.mass = ED_GetFieldIndex (&sv_pr_state, "mass"); sv_fields.health = PR_GetFieldOffset (&sv_pr_state, "health");
sv_fields.light_level = ED_GetFieldIndex (&sv_pr_state, "light_level"); sv_fields.frags = PR_GetFieldOffset (&sv_pr_state, "frags");
sv_fields.mins = ED_GetFieldIndex (&sv_pr_state, "mins"); sv_fields.weapon = PR_GetFieldOffset (&sv_pr_state, "weapon");
sv_fields.maxs = ED_GetFieldIndex (&sv_pr_state, "maxs"); sv_fields.weaponmodel = PR_GetFieldOffset (&sv_pr_state, "weaponmodel");
sv_fields.size = ED_GetFieldIndex (&sv_pr_state, "size"); sv_fields.weaponframe = PR_GetFieldOffset (&sv_pr_state, "weaponframe");
sv_fields.touch = ED_GetFieldIndex (&sv_pr_state, "touch"); sv_fields.currentammo = PR_GetFieldOffset (&sv_pr_state, "currentammo");
sv_fields.use = ED_GetFieldIndex (&sv_pr_state, "use"); sv_fields.ammo_shells = PR_GetFieldOffset (&sv_pr_state, "ammo_shells");
sv_fields.think = ED_GetFieldIndex (&sv_pr_state, "think"); sv_fields.ammo_nails = PR_GetFieldOffset (&sv_pr_state, "ammo_nails");
sv_fields.blocked = ED_GetFieldIndex (&sv_pr_state, "blocked"); sv_fields.ammo_rockets = PR_GetFieldOffset (&sv_pr_state, "ammo_rockets");
sv_fields.nextthink = ED_GetFieldIndex (&sv_pr_state, "nextthink"); sv_fields.ammo_cells = PR_GetFieldOffset (&sv_pr_state, "ammo_cells");
sv_fields.groundentity = ED_GetFieldIndex (&sv_pr_state, "groundentity"); sv_fields.items = PR_GetFieldOffset (&sv_pr_state, "items");
sv_fields.health = ED_GetFieldIndex (&sv_pr_state, "health"); sv_fields.items2 = PR_GetFieldOffset (&sv_pr_state, "items2");
sv_fields.frags = ED_GetFieldIndex (&sv_pr_state, "frags"); sv_fields.takedamage = PR_GetFieldOffset (&sv_pr_state, "takedamage");
sv_fields.weapon = ED_GetFieldIndex (&sv_pr_state, "weapon"); sv_fields.chain = PR_GetFieldOffset (&sv_pr_state, "chain");
sv_fields.weaponmodel = ED_GetFieldIndex (&sv_pr_state, "weaponmodel"); sv_fields.deadflag = PR_GetFieldOffset (&sv_pr_state, "deadflag");
sv_fields.weaponframe = ED_GetFieldIndex (&sv_pr_state, "weaponframe"); sv_fields.view_ofs = PR_GetFieldOffset (&sv_pr_state, "view_ofs");
sv_fields.currentammo = ED_GetFieldIndex (&sv_pr_state, "currentammo"); sv_fields.button0 = PR_GetFieldOffset (&sv_pr_state, "button0");
sv_fields.ammo_shells = ED_GetFieldIndex (&sv_pr_state, "ammo_shells"); sv_fields.button1 = PR_GetFieldOffset (&sv_pr_state, "button1");
sv_fields.ammo_nails = ED_GetFieldIndex (&sv_pr_state, "ammo_nails"); sv_fields.button2 = PR_GetFieldOffset (&sv_pr_state, "button2");
sv_fields.ammo_rockets = ED_GetFieldIndex (&sv_pr_state, "ammo_rockets"); sv_fields.impulse = PR_GetFieldOffset (&sv_pr_state, "impulse");
sv_fields.ammo_cells = ED_GetFieldIndex (&sv_pr_state, "ammo_cells"); sv_fields.fixangle = PR_GetFieldOffset (&sv_pr_state, "fixangle");
sv_fields.items = ED_GetFieldIndex (&sv_pr_state, "items"); sv_fields.v_angle = PR_GetFieldOffset (&sv_pr_state, "v_angle");
sv_fields.items2 = ED_GetFieldIndex (&sv_pr_state, "items2"); sv_fields.idealpitch = PR_GetFieldOffset (&sv_pr_state, "idealpitch");
sv_fields.takedamage = ED_GetFieldIndex (&sv_pr_state, "takedamage"); sv_fields.pitch_speed = PR_GetFieldOffset (&sv_pr_state, "pitch_speed");
sv_fields.chain = ED_GetFieldIndex (&sv_pr_state, "chain"); sv_fields.netname = PR_GetFieldOffset (&sv_pr_state, "netname");
sv_fields.deadflag = ED_GetFieldIndex (&sv_pr_state, "deadflag"); sv_fields.enemy = PR_GetFieldOffset (&sv_pr_state, "enemy");
sv_fields.view_ofs = ED_GetFieldIndex (&sv_pr_state, "view_ofs"); sv_fields.flags = PR_GetFieldOffset (&sv_pr_state, "flags");
sv_fields.button0 = ED_GetFieldIndex (&sv_pr_state, "button0"); sv_fields.colormap = PR_GetFieldOffset (&sv_pr_state, "colormap");
sv_fields.button1 = ED_GetFieldIndex (&sv_pr_state, "button1"); sv_fields.team = PR_GetFieldOffset (&sv_pr_state, "team");
sv_fields.button2 = ED_GetFieldIndex (&sv_pr_state, "button2"); sv_fields.max_health = PR_GetFieldOffset (&sv_pr_state, "max_health");
sv_fields.impulse = ED_GetFieldIndex (&sv_pr_state, "impulse"); sv_fields.teleport_time = PR_GetFieldOffset (&sv_pr_state, "teleport_time");
sv_fields.fixangle = ED_GetFieldIndex (&sv_pr_state, "fixangle"); sv_fields.armortype = PR_GetFieldOffset (&sv_pr_state, "armortype");
sv_fields.v_angle = ED_GetFieldIndex (&sv_pr_state, "v_angle"); sv_fields.armorvalue = PR_GetFieldOffset (&sv_pr_state, "armorvalue");
sv_fields.idealpitch = ED_GetFieldIndex (&sv_pr_state, "idealpitch"); sv_fields.waterlevel = PR_GetFieldOffset (&sv_pr_state, "waterlevel");
sv_fields.pitch_speed = ED_GetFieldIndex (&sv_pr_state, "pitch_speed"); sv_fields.watertype = PR_GetFieldOffset (&sv_pr_state, "watertype");
sv_fields.netname = ED_GetFieldIndex (&sv_pr_state, "netname"); sv_fields.ideal_yaw = PR_GetFieldOffset (&sv_pr_state, "ideal_yaw");
sv_fields.enemy = ED_GetFieldIndex (&sv_pr_state, "enemy"); sv_fields.yaw_speed = PR_GetFieldOffset (&sv_pr_state, "yaw_speed");
sv_fields.flags = ED_GetFieldIndex (&sv_pr_state, "flags"); sv_fields.aiment = PR_GetFieldOffset (&sv_pr_state, "aiment");
sv_fields.colormap = ED_GetFieldIndex (&sv_pr_state, "colormap"); sv_fields.goalentity = PR_GetFieldOffset (&sv_pr_state, "goalentity");
sv_fields.team = ED_GetFieldIndex (&sv_pr_state, "team"); sv_fields.spawnflags = PR_GetFieldOffset (&sv_pr_state, "spawnflags");
sv_fields.max_health = ED_GetFieldIndex (&sv_pr_state, "max_health"); sv_fields.target = PR_GetFieldOffset (&sv_pr_state, "target");
sv_fields.teleport_time = ED_GetFieldIndex (&sv_pr_state, "teleport_time"); sv_fields.targetname = PR_GetFieldOffset (&sv_pr_state, "targetname");
sv_fields.armortype = ED_GetFieldIndex (&sv_pr_state, "armortype"); sv_fields.dmg_take = PR_GetFieldOffset (&sv_pr_state, "dmg_take");
sv_fields.armorvalue = ED_GetFieldIndex (&sv_pr_state, "armorvalue"); sv_fields.dmg_save = PR_GetFieldOffset (&sv_pr_state, "dmg_save");
sv_fields.waterlevel = ED_GetFieldIndex (&sv_pr_state, "waterlevel"); sv_fields.dmg_inflictor = PR_GetFieldOffset (&sv_pr_state, "dmg_inflictor");
sv_fields.watertype = ED_GetFieldIndex (&sv_pr_state, "watertype"); sv_fields.owner = PR_GetFieldOffset (&sv_pr_state, "owner");
sv_fields.ideal_yaw = ED_GetFieldIndex (&sv_pr_state, "ideal_yaw"); sv_fields.movedir = PR_GetFieldOffset (&sv_pr_state, "movedir");
sv_fields.yaw_speed = ED_GetFieldIndex (&sv_pr_state, "yaw_speed"); sv_fields.message = PR_GetFieldOffset (&sv_pr_state, "message");
sv_fields.aiment = ED_GetFieldIndex (&sv_pr_state, "aiment"); sv_fields.sounds = PR_GetFieldOffset (&sv_pr_state, "sounds");
sv_fields.goalentity = ED_GetFieldIndex (&sv_pr_state, "goalentity"); sv_fields.noise = PR_GetFieldOffset (&sv_pr_state, "noise");
sv_fields.spawnflags = ED_GetFieldIndex (&sv_pr_state, "spawnflags"); sv_fields.noise1 = PR_GetFieldOffset (&sv_pr_state, "noise1");
sv_fields.target = ED_GetFieldIndex (&sv_pr_state, "target"); sv_fields.noise2 = PR_GetFieldOffset (&sv_pr_state, "noise2");
sv_fields.targetname = ED_GetFieldIndex (&sv_pr_state, "targetname"); sv_fields.noise3 = PR_GetFieldOffset (&sv_pr_state, "noise3");
sv_fields.dmg_take = ED_GetFieldIndex (&sv_pr_state, "dmg_take"); sv_fields.dmg = PR_GetFieldOffset (&sv_pr_state, "dmg");
sv_fields.dmg_save = ED_GetFieldIndex (&sv_pr_state, "dmg_save"); sv_fields.dmgtime = PR_GetFieldOffset (&sv_pr_state, "dmgtime");
sv_fields.dmg_inflictor = ED_GetFieldIndex (&sv_pr_state, "dmg_inflictor"); sv_fields.air_finished = PR_GetFieldOffset (&sv_pr_state, "air_finished");
sv_fields.owner = ED_GetFieldIndex (&sv_pr_state, "owner"); sv_fields.pain_finished = PR_GetFieldOffset (&sv_pr_state, "pain_finished");
sv_fields.movedir = ED_GetFieldIndex (&sv_pr_state, "movedir"); sv_fields.radsuit_finished = PR_GetFieldOffset (&sv_pr_state, "radsuit_finished");
sv_fields.message = ED_GetFieldIndex (&sv_pr_state, "message"); sv_fields.speed = PR_GetFieldOffset (&sv_pr_state, "speed");
sv_fields.sounds = ED_GetFieldIndex (&sv_pr_state, "sounds");
sv_fields.noise = ED_GetFieldIndex (&sv_pr_state, "noise");
sv_fields.noise1 = ED_GetFieldIndex (&sv_pr_state, "noise1");
sv_fields.noise2 = ED_GetFieldIndex (&sv_pr_state, "noise2");
sv_fields.noise3 = ED_GetFieldIndex (&sv_pr_state, "noise3");
sv_fields.dmg = ED_GetFieldIndex (&sv_pr_state, "dmg");
sv_fields.dmgtime = ED_GetFieldIndex (&sv_pr_state, "dmgtime");
sv_fields.air_finished = ED_GetFieldIndex (&sv_pr_state, "air_finished");
sv_fields.pain_finished = ED_GetFieldIndex (&sv_pr_state, "pain_finished");
sv_fields.radsuit_finished = ED_GetFieldIndex (&sv_pr_state, "radsuit_finished");
sv_fields.speed = ED_GetFieldIndex (&sv_pr_state, "speed");
} }
extern builtin_t sv_builtins[]; extern builtin_t sv_builtins[];
@ -332,4 +327,3 @@ SV_Progs_Init_Cvars (void)
saved3 = Cvar_Get ("saved3", "0", CVAR_ARCHIVE, NULL, "No Description"); saved3 = Cvar_Get ("saved3", "0", CVAR_ARCHIVE, NULL, "No Description");
saved4 = Cvar_Get ("saved4", "0", CVAR_ARCHIVE, NULL, "No Description"); saved4 = Cvar_Get ("saved4", "0", CVAR_ARCHIVE, NULL, "No Description");
} }

View file

@ -51,7 +51,8 @@ typedef struct {
vec3_t boxmins, boxmaxs; // enclose the test object along vec3_t boxmins, boxmaxs; // enclose the test object along
// entire move // entire move
float *mins, *maxs; // size of the moving object float *mins, *maxs; // size of the moving object
vec3_t mins2, maxs2; // size when clipping against monsters vec3_t mins2, maxs2; // size when clipping against
// monsters
float *start, *end; float *start, *end;
trace_t trace; trace_t trace;
int type; int type;
@ -129,9 +130,9 @@ SV_HullForBox (vec3_t mins, vec3_t maxs)
SV_HullForEntity SV_HullForEntity
Returns a hull that can be used for testing or clipping an object of Returns a hull that can be used for testing or clipping an object of
mins/maxs size. Offset is filled in to contain the adjustment that must mins/maxs size. Offset is filled in to contain the adjustment that
be added to the testing object's origin to get a point to use with the must be added to the testing object's origin to get a point to use with
returned hull. the returned hull.
*/ */
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)
@ -142,8 +143,8 @@ SV_HullForEntity (edict_t *ent, vec3_t mins, vec3_t maxs, vec3_t offset)
hull_t *hull; hull_t *hull;
// decide which clipping hull to use, based on the size // decide which clipping hull to use, based on the size
if (SVFIELD (ent, solid, float) == SOLID_BSP) { // explicit hulls in the if (SVFIELD (ent, solid, float) == SOLID_BSP) {
// BSP model // explicit hulls in the BSP model
if (SVFIELD (ent, movetype, float) != MOVETYPE_PUSH) if (SVFIELD (ent, movetype, float) != MOVETYPE_PUSH)
Sys_Error ("SOLID_BSP without MOVETYPE_PUSH"); Sys_Error ("SOLID_BSP without MOVETYPE_PUSH");
@ -163,8 +164,7 @@ SV_HullForEntity (edict_t *ent, vec3_t mins, vec3_t maxs, vec3_t offset)
// calculate an offset value to center the origin // calculate an offset value to center the origin
VectorSubtract (hull->clip_mins, mins, offset); VectorSubtract (hull->clip_mins, mins, offset);
VectorAdd (offset, SVFIELD (ent, origin, vector), offset); VectorAdd (offset, SVFIELD (ent, origin, vector), offset);
} else { // create a temp hull from bounding } else { // create a temp hull from bounding box sizes
// box sizes
VectorSubtract (SVFIELD (ent, mins, vector), maxs, hullmins); VectorSubtract (SVFIELD (ent, mins, vector), maxs, hullmins);
VectorSubtract (SVFIELD (ent, maxs, vector), mins, hullmaxs); VectorSubtract (SVFIELD (ent, maxs, vector), mins, hullmaxs);
hull = SV_HullForBox (hullmins, hullmaxs); hull = SV_HullForBox (hullmins, hullmaxs);
@ -175,8 +175,9 @@ SV_HullForEntity (edict_t *ent, vec3_t mins, vec3_t maxs, vec3_t offset)
return hull; return hull;
} }
/* /*
ENTITY AREA CHECKING ======================================================== ENTITY AREA CHECKING
*/ */
typedef struct areanode_s { typedef struct areanode_s {
@ -268,7 +269,8 @@ SV_TouchLinks (edict_t *ent, areanode_t *node)
touch = EDICT_FROM_AREA (l); touch = EDICT_FROM_AREA (l);
if (touch == ent) if (touch == ent)
continue; continue;
if (!SVFIELD (touch, touch, func) || SVFIELD (touch, solid, float) != SOLID_TRIGGER) if (!SVFIELD (touch, touch, func)
|| SVFIELD (touch, solid, float) != SOLID_TRIGGER)
continue; continue;
if (SVFIELD (ent, absmin, vector)[0] > SVFIELD (touch, absmax, vector)[0] if (SVFIELD (ent, absmin, vector)[0] > SVFIELD (touch, absmax, vector)[0]
|| SVFIELD (ent, absmin, vector)[1] > SVFIELD (touch, absmax, vector)[1] || SVFIELD (ent, absmin, vector)[1] > SVFIELD (touch, absmax, vector)[1]
@ -277,11 +279,11 @@ SV_TouchLinks (edict_t *ent, areanode_t *node)
|| SVFIELD (ent, absmax, vector)[1] < SVFIELD (touch, absmin, vector)[1] || SVFIELD (ent, absmax, vector)[1] < SVFIELD (touch, absmin, vector)[1]
|| SVFIELD (ent, absmax, vector)[2] < SVFIELD (touch, absmin, vector)[2]) || SVFIELD (ent, absmax, vector)[2] < SVFIELD (touch, absmin, vector)[2])
continue; continue;
old_self = *sv_globals.self; old_self = *sv_globals.self;
old_other = *sv_globals.other; old_other = *sv_globals.other;
*sv_globals.self = *sv_globals.self = EDICT_TO_PROG (&sv_pr_state, touch);
EDICT_TO_PROG (&sv_pr_state, touch);
*sv_globals.other = EDICT_TO_PROG (&sv_pr_state, ent); *sv_globals.other = EDICT_TO_PROG (&sv_pr_state, ent);
*sv_globals.time = sv.time; *sv_globals.time = sv.time;
PR_ExecuteProgram (&sv_pr_state, SVFIELD (touch, touch, func)); PR_ExecuteProgram (&sv_pr_state, SVFIELD (touch, touch, func));
@ -324,10 +326,11 @@ SV_FindTouchedLeafs (edict_t *ent, mnode_t *node)
ent->num_leafs++; ent->num_leafs++;
return; return;
} }
// NODE_MIXED
// NODE_MIXED
splitplane = node->plane; splitplane = node->plane;
sides = BOX_ON_PLANE_SIDE (SVFIELD (ent, absmin, vector), SVFIELD (ent, absmax, vector), splitplane); sides = BOX_ON_PLANE_SIDE (SVFIELD (ent, absmin, vector),
SVFIELD (ent, absmax, vector), splitplane);
// recurse down the contacted sides // recurse down the contacted sides
if (sides & 1) if (sides & 1)
@ -353,33 +356,10 @@ SV_LinkEdict (edict_t *ent, qboolean touch_triggers)
return; return;
// set the abs box // set the abs box
VectorAdd (SVFIELD (ent, origin, vector), SVFIELD (ent, mins, vector),
#ifdef QUAKE2 SVFIELD (ent, absmin, vector));
if (SVFIELD (ent, solid, float) == SOLID_BSP && VectorAdd (SVFIELD (ent, origin, vector), SVFIELD (ent, maxs, vector),
(SVFIELD (ent, angles, float)[0] || SVFIELD (ent, angles, float)[1] SVFIELD (ent, absmax, vector));
|| SVFIELD (ent, angles, float)[2])) { // expand for rotation
float max, v;
int i;
max = 0;
for (i = 0; i < 3; i++) {
v = fabs (SVFIELD (ent, mins, float)[i]);
if (v > max)
max = v;
v = fabs (SVFIELD (ent, maxs, float)[i]);
if (v > max)
max = v;
}
for (i = 0; i < 3; i++) {
SVFIELD (ent, absmin, float)[i] = SVFIELD (ent, origin, float)[i] - max;
SVFIELD (ent, absmax, float)[i] = SVFIELD (ent, origin, float)[i] + max;
}
} else
#endif
{
VectorAdd (SVFIELD (ent, origin, vector), SVFIELD (ent, mins, vector), SVFIELD (ent, absmin, vector));
VectorAdd (SVFIELD (ent, origin, vector), SVFIELD (ent, maxs, vector), SVFIELD (ent, absmax, vector));
}
// to make items easier to pick up and allow them to be grabbed off // to make items easier to pick up and allow them to be grabbed off
// of shelves, the abs sizes are expanded // of shelves, the abs sizes are expanded
@ -425,17 +405,17 @@ SV_LinkEdict (edict_t *ent, qboolean touch_triggers)
else else
InsertLinkBefore (&ent->area, &node->solid_edicts); InsertLinkBefore (&ent->area, &node->solid_edicts);
// if touch_triggers, touch all entities at this node and decend for more // if touch_triggers, touch all entities at this node and descend for more
if (touch_triggers) if (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)
@ -463,7 +443,7 @@ SV_HullPointContents (hull_t *hull, int num, vec3_t p)
return num; return num;
} }
#endif // USE_INTEL_ASM #endif // !USE_INTEL_ASM
int int
@ -508,7 +488,7 @@ SV_TestEntityPosition (edict_t *ent)
/* /*
LINE TESTING IN HULLS ======================================================= LINE TESTING IN HULLS
*/ */
// 1/32 epsilon to keep floating point happy // 1/32 epsilon to keep floating point happy
@ -668,58 +648,10 @@ SV_ClipMoveToEntity (edict_t *ent, vec3_t start, vec3_t mins, vec3_t maxs,
VectorSubtract (start, offset, start_l); VectorSubtract (start, offset, start_l);
VectorSubtract (end, offset, end_l); VectorSubtract (end, offset, end_l);
#ifdef QUAKE2
// rotate start and end into the models frame of reference
if (SVFIELD (ent, solid, float) == SOLID_BSP &&
(SVFIELD (ent, angles, float)[0] || SVFIELD (ent, angles, float)[1]
|| SVFIELD (ent, angles, float)[2])) {
vec3_t a;
vec3_t forward, right, up;
vec3_t temp;
AngleVectors (SVFIELD (ent, angles, float), forward, right, up);
VectorCopy (start_l, temp);
start_l[0] = DotProduct (temp, forward);
start_l[1] = -DotProduct (temp, right);
start_l[2] = DotProduct (temp, up);
VectorCopy (end_l, temp);
end_l[0] = DotProduct (temp, forward);
end_l[1] = -DotProduct (temp, right);
end_l[2] = DotProduct (temp, up);
}
#endif
// trace a line through the apropriate clipping hull // trace a line through the apropriate clipping hull
SV_RecursiveHullCheck (hull, hull->firstclipnode, 0, 1, start_l, end_l, SV_RecursiveHullCheck (hull, hull->firstclipnode, 0, 1, start_l, end_l,
&trace); &trace);
#ifdef QUAKE2
// rotate endpos back to world frame of reference
if (SVFIELD (ent, solid, float) == SOLID_BSP &&
(SVFIELD (ent, angles, float)[0] || SVFIELD (ent, angles, float)[1] || SVFIELD (ent, angles, float)[2])) {
vec3_t a;
vec3_t forward, right, up;
vec3_t temp;
if (trace.fraction != 1) {
VectorSubtract (vec3_origin, SVFIELD (ent, angles, float), a);
AngleVectors (a, forward, right, up);
VectorCopy (trace.endpos, temp);
trace.endpos[0] = DotProduct (temp, forward);
trace.endpos[1] = -DotProduct (temp, right);
trace.endpos[2] = DotProduct (temp, up);
VectorCopy (trace.plane.normal, temp);
trace.plane.normal[0] = DotProduct (temp, forward);
trace.plane.normal[1] = -DotProduct (temp, right);
trace.plane.normal[2] = DotProduct (temp, up);
}
}
#endif
// fix trace up by the offset // fix trace up by the offset
if (trace.fraction != 1) if (trace.fraction != 1)
VectorAdd (trace.endpos, offset, trace.endpos); VectorAdd (trace.endpos, offset, trace.endpos);
@ -755,7 +687,8 @@ SV_ClipToLinks (areanode_t *node, moveclip_t * clip)
if (SVFIELD (touch, solid, float) == SOLID_TRIGGER) if (SVFIELD (touch, solid, float) == SOLID_TRIGGER)
Sys_Error ("Trigger in clipping list"); Sys_Error ("Trigger in clipping list");
if (clip->type == MOVE_NOMONSTERS && SVFIELD (touch, solid, float) != SOLID_BSP) if (clip->type == MOVE_NOMONSTERS && SVFIELD (touch, solid, float)
!= SOLID_BSP)
continue; continue;
if (clip->boxmins[0] > SVFIELD (touch, absmax, vector)[0] if (clip->boxmins[0] > SVFIELD (touch, absmax, vector)[0]
@ -766,7 +699,7 @@ SV_ClipToLinks (areanode_t *node, moveclip_t * clip)
|| clip->boxmaxs[2] < SVFIELD (touch, absmin, vector)[2]) || clip->boxmaxs[2] < SVFIELD (touch, absmin, vector)[2])
continue; continue;
if (clip->passedict && SVFIELD (clip->passedict, size, vector)[0] if (clip->passedict != 0 && SVFIELD (clip->passedict, size, vector)[0]
&& !SVFIELD (touch, size, vector)[0]) && !SVFIELD (touch, size, vector)[0])
continue; // points never interact continue; // points never interact
@ -774,11 +707,12 @@ SV_ClipToLinks (areanode_t *node, moveclip_t * clip)
if (clip->trace.allsolid) if (clip->trace.allsolid)
return; return;
if (clip->passedict) { if (clip->passedict) {
if (PROG_TO_EDICT (&sv_pr_state, SVFIELD (touch, owner, entity)) == if (PROG_TO_EDICT (&sv_pr_state, SVFIELD (touch, owner, entity))
clip->passedict) continue; // don't clip against own missiles == clip->passedict)
continue; // don't clip against own missiles
if (PROG_TO_EDICT (&sv_pr_state, if (PROG_TO_EDICT (&sv_pr_state,
SVFIELD (clip->passedict, owner, entity)) SVFIELD (clip->passedict, owner, entity)) == touch)
== touch) continue; // don't clip against owner continue; // don't clip against owner
} }
if ((int) SVFIELD (touch, flags, float) & FL_MONSTER) if ((int) SVFIELD (touch, flags, float) & FL_MONSTER)

View file

@ -1,7 +1,7 @@
/* /*
game.c game.c
game specific support game specific support (notably hipnotic, rogue and abyss)
Copyright (C) 1996-1997 Id Software, Inc. Copyright (C) 1996-1997 Id Software, Inc.
Copyright (C) 1999,2000 contributors of the QuakeForge project Copyright (C) 1999,2000 contributors of the QuakeForge project

View file

@ -149,8 +149,7 @@ SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
neworg[2] += 8; neworg[2] += 8;
} }
trace = trace =
SV_Move (SVFIELD (ent, origin, vector), SVFIELD (ent, mins, vector), SVFIELD (ent, maxs, vector), neworg, false, SV_Move (SVFIELD (ent, origin, vector), SVFIELD (ent, mins, vector), SVFIELD (ent, maxs, vector), neworg, false, ent);
ent);
if (trace.fraction == 1) { if (trace.fraction == 1) {
if (((int) SVFIELD (ent, flags, float) & FL_SWIM) if (((int) SVFIELD (ent, flags, float) & FL_SWIM)
@ -394,7 +393,8 @@ SV_MoveToGoal (progs_t *pr)
} }
// if the next step hits the enemy, return immediately // if the next step hits the enemy, return immediately
if (PROG_TO_EDICT (&sv_pr_state, SVFIELD (ent, enemy, entity)) != sv.edicts if (PROG_TO_EDICT (&sv_pr_state, SVFIELD (ent, enemy, entity)) != sv.edicts
&& SV_CloseEnough (ent, goal, dist)) return; && SV_CloseEnough (ent, goal, dist))
return;
// bump around... // bump around...
if ((rand () & 3) == 1 || !SV_StepDirection (ent, SVFIELD (ent, ideal_yaw, float), dist)) { if ((rand () & 3) == 1 || !SV_StepDirection (ent, SVFIELD (ent, ideal_yaw, float), dist)) {

View file

@ -300,17 +300,20 @@ SV_Progs_Init (void)
sv_pr_state.parse_field = parse_field; sv_pr_state.parse_field = parse_field;
sv_pr_state.prune_edict = prune_edict; sv_pr_state.prune_edict = prune_edict;
Cmd_AddCommand ("edict", ED_PrintEdict_f, "Report information on a given edict in the game. (edict (edict number))"); Cmd_AddCommand ("edict", ED_PrintEdict_f,
Cmd_AddCommand ("edicts", ED_PrintEdicts_f, "Display information on all edicts in the game."); "Report information on a given edict in the game. (edict (edict number))");
Cmd_AddCommand ("edictcount", ED_Count_f, "Display summary information on the edicts in the game."); Cmd_AddCommand ("edicts", ED_PrintEdicts_f,
Cmd_AddCommand ("profile", PR_Profile_f, "FIXME: Report information about QuakeC Stuff (\?\?\?) No Description"); "Display information on all edicts in the game.");
Cmd_AddCommand ("edictcount", ED_Count_f,
"Display summary information on the edicts in the game.");
Cmd_AddCommand ("profile", PR_Profile_f,
"FIXME: Report information about QuakeC Stuff (\?\?\?) No Description");
} }
void void
SV_Progs_Init_Cvars (void) SV_Progs_Init_Cvars (void)
{ {
r_skyname = r_skyname = Cvar_Get ("r_skyname", "", CVAR_SERVERINFO, Cvar_Info,
Cvar_Get ("r_skyname", "", CVAR_SERVERINFO, Cvar_Info,
"name of skybox"); "name of skybox");
sv_progs = Cvar_Get ("sv_progs", "qwprogs.dat", CVAR_ROM, NULL, sv_progs = Cvar_Get ("sv_progs", "qwprogs.dat", CVAR_ROM, NULL,
"Allows selectable game progs if you have several " "Allows selectable game progs if you have several "

View file

@ -461,7 +461,8 @@ SV_TestEntityPosition (edict_t *ent)
trace_t trace; trace_t trace;
trace = SV_Move (SVFIELD (ent, origin, vector), trace = SV_Move (SVFIELD (ent, origin, vector),
SVFIELD (ent, mins, vector), SVFIELD (ent, maxs, vector), SVFIELD (ent, mins, vector),
SVFIELD (ent, maxs, vector),
SVFIELD (ent, origin, vector), 0, ent); SVFIELD (ent, origin, vector), 0, ent);
if (trace.startsolid) if (trace.startsolid)
@ -684,15 +685,18 @@ SV_ClipToLinks (areanode_t *node, moveclip_t * clip)
continue; continue;
if (clip->passedict != 0 && SVFIELD (clip->passedict, size, vector)[0] if (clip->passedict != 0 && SVFIELD (clip->passedict, size, vector)[0]
&& !SVFIELD (touch, size, vector)[0]) continue; // points never interact && !SVFIELD (touch, size, vector)[0])
continue; // points never interact
// might intersect, so do an exact clip // might intersect, so do an exact clip
if (clip->trace.allsolid) if (clip->trace.allsolid)
return; return;
if (clip->passedict) { if (clip->passedict) {
if (PROG_TO_EDICT (&sv_pr_state, SVFIELD (touch, owner, entity)) == clip->passedict) if (PROG_TO_EDICT (&sv_pr_state, SVFIELD (touch, owner, entity))
== clip->passedict)
continue; // don't clip against own missiles continue; // don't clip against own missiles
if (PROG_TO_EDICT (&sv_pr_state, SVFIELD (clip->passedict, owner, entity)) == touch) if (PROG_TO_EDICT (&sv_pr_state,
SVFIELD (clip->passedict, owner, entity)) == touch)
continue; // don't clip against owner continue; // don't clip against owner
} }