Fixed a few warning messages.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1972 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2006-02-17 19:54:47 +00:00
parent d245b06c91
commit 0bd1517522
12 changed files with 123 additions and 99 deletions

View file

@ -2940,7 +2940,7 @@ void Host_Frame (double time)
*/ */
Mod_Think(); //think even on idle (which means small walls and a fast cpu can get more surfaces done. Mod_Think(); //think even on idle (which means small walls and a fast cpu can get more surfaces done.
if (cl_maxfps.value>0 && cl_netfps.value>0 || cls.demoplayback) if ((cl_maxfps.value>0 && cl_netfps.value>0) || cls.demoplayback)
{ //limit the fps freely, and expect the netfps to cope. { //limit the fps freely, and expect the netfps to cope.
if ((realtime - oldrealtime) < 1/cl_maxfps.value) if ((realtime - oldrealtime) < 1/cl_maxfps.value)
return; return;

View file

@ -512,7 +512,7 @@ void Model_NextDownload (void)
// char *twf; // char *twf;
char *s; char *s;
int i; int i;
extern char gamedirfile[]; // extern char gamedirfile[];
Con_TPrintf (TLC_CHECKINGMODELS); Con_TPrintf (TLC_CHECKINGMODELS);
@ -3162,7 +3162,6 @@ char *CL_ParseChat(char *text, player_info_t **player)
int offset=0; int offset=0;
qboolean suppress_talksound; qboolean suppress_talksound;
char *p; char *p;
extern cvar_t cl_parsewhitetext;
char *s; char *s;
int check_flood; int check_flood;
@ -3482,7 +3481,7 @@ void CL_PrintChat(player_info_t *plr, char *rawmsg, char *msg, int plrflags)
{ {
char *t, *u; char *t, *u;
while (t = strchr(msg, '{')) while ((t = strchr(msg, '{')))
{ {
u = strchr(msg, '}'); u = strchr(msg, '}');
if (u) if (u)
@ -3789,7 +3788,7 @@ void CL_ParseServerMessage (void)
if (TP_SuppressMessage(s)) if (TP_SuppressMessage(s))
break; //if this was unseen-sent from us, ignore it. break; //if this was unseen-sent from us, ignore it.
if (msg = CL_ParseChat(s, &plr)) if ((msg = CL_ParseChat(s, &plr)))
{ {
CL_ParsePrint(s, i); CL_ParsePrint(s, i);
CL_PrintChat(plr, s, msg, msgflags); CL_PrintChat(plr, s, msg, msgflags);
@ -4254,7 +4253,7 @@ void CLQ2_ParseServerMessage (void)
char *msg; char *msg;
player_info_t *plr = NULL; player_info_t *plr = NULL;
if (msg = CL_ParseChat(s, &plr)) if ((msg = CL_ParseChat(s, &plr)))
{ {
CL_ParsePrint(s, i); CL_ParsePrint(s, i);
CL_PrintChat(plr, s, msg, msgflags); CL_PrintChat(plr, s, msg, msgflags);
@ -4491,7 +4490,7 @@ void CLNQ_ParseServerMessage (void)
char *msg; char *msg;
player_info_t *plr = NULL; player_info_t *plr = NULL;
if (msg = CL_ParseChat(s+1, &plr)) if ((msg = CL_ParseChat(s+1, &plr)))
{ {
CL_ParsePrint(s+1, PRINT_CHAT); CL_ParsePrint(s+1, PRINT_CHAT);
CL_PrintChat(plr, s+1, msg, msgflags); CL_PrintChat(plr, s+1, msg, msgflags);

View file

@ -1026,4 +1026,5 @@ void CLQ3_SendConnectPacket(netadr_t to)
Huff_PreferedCompressionCRC(); Huff_PreferedCompressionCRC();
NET_SendPacket (NS_CLIENT, msg.cursize, msg.data, to); NET_SendPacket (NS_CLIENT, msg.cursize, msg.data, to);
} }
#endif #endif

View file

@ -175,7 +175,7 @@ static void WriteInstalledPackages(void)
{ {
if (p->flags & DPF_HAVEAVERSION) if (p->flags & DPF_HAVEAVERSION)
{ {
s = ("\"%s\" \"%s\" \"%s\" %i \"%s\"\n", p->fullname, p->src, p->dest, p->version, p->gamedir); s = va("\"%s\" \"%s\" \"%s\" %i \"%s\"\n", p->fullname, p->src, p->dest, p->version, p->gamedir);
VFS_WRITE(f, s, strlen(s)); VFS_WRITE(f, s, strlen(s));
} }
} }

View file

@ -427,7 +427,7 @@ void M_Menu_FPS_f (void)
#ifdef SWQUAKE #ifdef SWQUAKE
extern cvar_t d_smooth, d_mipscale, d_mipcap; extern cvar_t d_smooth, d_mipscale, d_mipcap;
#endif #endif
extern cvar_t r_stains, r_bloodstains, r_loadlits, r_dynamic, v_contentblend, show_fps, gl_skyboxname; extern cvar_t r_stains, r_bloodstains, r_loadlits, r_dynamic, v_contentblend, show_fps;
key_dest = key_menu; key_dest = key_menu;
m_state = m_complex; m_state = m_complex;

View file

@ -483,7 +483,7 @@ void M_Keys_Key (int k)
} }
else if (k != '`') else if (k != '`')
{ {
sprintf (cmd, "bind %s \"%s\"\n", Key_KeynumToString (k), bindnames[keys_cursor].command, false); sprintf (cmd, "bind %s \"%s\"\n", Key_KeynumToString (k), bindnames[keys_cursor].command);
Cbuf_InsertText (cmd, RESTRICT_LOCAL, false); Cbuf_InsertText (cmd, RESTRICT_LOCAL, false);
} }

View file

@ -76,6 +76,7 @@ void VMUI_fcloseall (int owner);
int VMQ3_GetFileList(char *path, char *ext, char *output, int buffersize); int VMQ3_GetFileList(char *path, char *ext, char *output, int buffersize);
//sans botlib //sans botlib
struct pc_token_s;
int Script_LoadFile(char *filename); int Script_LoadFile(char *filename);
void Script_Free(int handle); void Script_Free(int handle);
int Script_Read(int handle, struct pc_token_s *token); int Script_Read(int handle, struct pc_token_s *token);

View file

@ -64,6 +64,7 @@ cvar_t pr_tempstringcount = SCVAR("pr_tempstringcount", "16");
cvar_t pr_tempstringsize = SCVAR("pr_tempstringsize", "4096"); cvar_t pr_tempstringsize = SCVAR("pr_tempstringsize", "4096");
cvar_t sv_gameplayfix_blowupfallenzombies = SCVAR("sv_gameplayfix_blowupfallenzombies", "0"); cvar_t sv_gameplayfix_blowupfallenzombies = SCVAR("sv_gameplayfix_blowupfallenzombies", "0");
extern cvar_t sv_gameplayfix_noairborncorpse;
cvar_t sv_addon[MAXADDONS]; cvar_t sv_addon[MAXADDONS];
char cvargroup_progs[] = "Progs variables"; char cvargroup_progs[] = "Progs variables";
@ -933,6 +934,7 @@ void PR_Init(void)
Cvar_Register (&pr_tempstringsize, cvargroup_progs); Cvar_Register (&pr_tempstringsize, cvargroup_progs);
Cvar_Register (&sv_gameplayfix_blowupfallenzombies, cvargroup_progs); Cvar_Register (&sv_gameplayfix_blowupfallenzombies, cvargroup_progs);
Cvar_Register (&sv_gameplayfix_noairborncorpse, cvargroup_progs);
} }
void Q_InitProgs(void) void Q_InitProgs(void)

View file

@ -1601,7 +1601,7 @@ void SV_WritePlayersToClient (client_t *client, edict_t *clent, qbyte *pvs, size
for (j=0,cl=svs.clients ; j<sv.allocated_client_slots ; j++,cl++) for (j=0,cl=svs.clients ; j<sv.allocated_client_slots ; j++,cl++)
{ {
isbot = !cl->state && cl->name[0] || cl->protocol == SCP_BAD; isbot = !cl->state && (cl->name[0] || cl->protocol == SCP_BAD);
if (cl->state != cs_spawned) //this includes bots if (cl->state != cs_spawned) //this includes bots
if (!isbot || progstype == PROG_QW) //unless they're NQ bots... if (!isbot || progstype == PROG_QW) //unless they're NQ bots...
continue; continue;

View file

@ -8,7 +8,7 @@ of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details. See the GNU General Public License for more details.
@ -28,7 +28,7 @@ extern nqglobalvars_t realpr_nqglobal_struct;
pushmove objects do not obey gravity, and do not interact with each other or trigger fields, but block normal movement and push normal objects when they move. pushmove objects do not obey gravity, and do not interact with each other or trigger fields, but block normal movement and push normal objects when they move.
onground is set for toss objects when they come to a complete rest. it is set for steping or walking objects onground is set for toss objects when they come to a complete rest. it is set for steping or walking objects
doors, plats, etc are SOLID_BSP, and MOVETYPE_PUSH doors, plats, etc are SOLID_BSP, and MOVETYPE_PUSH
bonus items are SOLID_TRIGGER touch, and MOVETYPE_TOSS bonus items are SOLID_TRIGGER touch, and MOVETYPE_TOSS
@ -52,6 +52,7 @@ cvar_t sv_airaccelerate = SCVAR( "sv_airaccelerate", "0.7");
cvar_t sv_wateraccelerate = SCVAR( "sv_wateraccelerate", "10"); cvar_t sv_wateraccelerate = SCVAR( "sv_wateraccelerate", "10");
cvar_t sv_friction = SCVAR( "sv_friction", "4"); cvar_t sv_friction = SCVAR( "sv_friction", "4");
cvar_t sv_waterfriction = SCVAR( "sv_waterfriction", "4"); cvar_t sv_waterfriction = SCVAR( "sv_waterfriction", "4");
cvar_t sv_gameplayfix_noairborncorpse = SCVAR( "sv_gameplayfix_noairborncorpse", "0");
cvar_t pm_ktjump = SCVARF("pm_ktjump", "", CVAR_SERVERINFO); cvar_t pm_ktjump = SCVARF("pm_ktjump", "", CVAR_SERVERINFO);
cvar_t pm_bunnyspeedcap = SCVARF("pm_bunnyspeedcap", "", CVAR_SERVERINFO); cvar_t pm_bunnyspeedcap = SCVARF("pm_bunnyspeedcap", "", CVAR_SERVERINFO);
@ -146,7 +147,7 @@ qboolean SV_RunThink (edict_t *ent)
thinktime = ent->v->nextthink; thinktime = ent->v->nextthink;
if (thinktime <= 0 || thinktime > sv.time + host_frametime) if (thinktime <= 0 || thinktime > sv.time + host_frametime)
return true; return true;
if (thinktime < sv.time) if (thinktime < sv.time)
thinktime = sv.time; // don't let things stay in the past. thinktime = sv.time; // don't let things stay in the past.
// it is possible to start that way // it is possible to start that way
@ -166,7 +167,7 @@ qboolean SV_RunThink (edict_t *ent)
return true; return true;
if (thinktime > sv.time + host_frametime) if (thinktime > sv.time + host_frametime)
return true; return true;
if (thinktime < sv.time) if (thinktime < sv.time)
thinktime = sv.time; // don't let things stay in the past. thinktime = sv.time; // don't let things stay in the past.
// it is possible to start that way // it is possible to start that way
@ -198,10 +199,10 @@ Two entities have touched, so run their touch functions
void SV_Impact (edict_t *e1, edict_t *e2) void SV_Impact (edict_t *e1, edict_t *e2)
{ {
int old_self, old_other; int old_self, old_other;
old_self = pr_global_struct->self; old_self = pr_global_struct->self;
old_other = pr_global_struct->other; old_other = pr_global_struct->other;
pr_global_struct->time = sv.time; pr_global_struct->time = sv.time;
if (e1->v->touch && e1->v->solid != SOLID_NOT) if (e1->v->touch && e1->v->solid != SOLID_NOT)
{ {
@ -209,7 +210,7 @@ void SV_Impact (edict_t *e1, edict_t *e2)
pr_global_struct->other = EDICT_TO_PROG(svprogfuncs, e2); pr_global_struct->other = EDICT_TO_PROG(svprogfuncs, e2);
PR_ExecuteProgram (svprogfuncs, e1->v->touch); PR_ExecuteProgram (svprogfuncs, e1->v->touch);
} }
if (e2->v->touch && e2->v->solid != SOLID_NOT) if (e2->v->touch && e2->v->solid != SOLID_NOT)
{ {
pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, e2); pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, e2);
@ -275,14 +276,14 @@ int SV_FlyMove (edict_t *ent, float time, trace_t *steptrace)
vec3_t diff; vec3_t diff;
vec3_t startorg; vec3_t startorg;
numbumps = 4; numbumps = 4;
blocked = 0; blocked = 0;
VectorCopy (ent->v->velocity, original_velocity); VectorCopy (ent->v->velocity, original_velocity);
VectorCopy (ent->v->velocity, primal_velocity); VectorCopy (ent->v->velocity, primal_velocity);
numplanes = 0; numplanes = 0;
time_left = time; time_left = time;
VectorCopy (ent->v->origin, startorg); VectorCopy (ent->v->origin, startorg);
@ -336,9 +337,9 @@ int SV_FlyMove (edict_t *ent, float time, trace_t *steptrace)
if (ent->isfree) if (ent->isfree)
break; // removed by the impact function break; // removed by the impact function
time_left -= time_left * trace.fraction; time_left -= time_left * trace.fraction;
// cliped to another plane // cliped to another plane
if (numplanes >= MAX_CLIP_PLANES) if (numplanes >= MAX_CLIP_PLANES)
{ // this shouldn't really happen { // this shouldn't really happen
@ -453,7 +454,7 @@ trace_t SV_PushEntity (edict_t *ent, vec3_t push)
{ {
trace_t trace; trace_t trace;
vec3_t end; vec3_t end;
VectorAdd (ent->v->origin, push, end); VectorAdd (ent->v->origin, push, end);
if (ent->v->movetype == MOVETYPE_FLYMISSILE) if (ent->v->movetype == MOVETYPE_FLYMISSILE)
@ -463,7 +464,7 @@ trace_t SV_PushEntity (edict_t *ent, vec3_t push)
trace = SV_Move (ent->v->origin, ent->v->mins, ent->v->maxs, end, MOVE_NOMONSTERS, ent); trace = SV_Move (ent->v->origin, ent->v->mins, ent->v->maxs, end, MOVE_NOMONSTERS, ent);
else else
trace = SV_Move (ent->v->origin, ent->v->mins, ent->v->maxs, end, MOVE_NORMAL, ent); trace = SV_Move (ent->v->origin, ent->v->mins, ent->v->maxs, end, MOVE_NORMAL, ent);
// if (trace.ent) // if (trace.ent)
// VectorMA(trace.endpos, sv_impactpush.value, trace.plane.normal, ent->v->origin); // VectorMA(trace.endpos, sv_impactpush.value, trace.plane.normal, ent->v->origin);
// else // else
@ -471,10 +472,10 @@ trace_t SV_PushEntity (edict_t *ent, vec3_t push)
SV_LinkEdict (ent, true); SV_LinkEdict (ent, true);
if (trace.ent) if (trace.ent)
SV_Impact (ent, trace.ent); SV_Impact (ent, trace.ent);
return trace; return trace;
} }
@ -537,7 +538,7 @@ qboolean SV_PushAngles (edict_t *pusher, vec3_t move, vec3_t amove)
check = EDICT_NUM(svprogfuncs, e); check = EDICT_NUM(svprogfuncs, e);
if (check->isfree) if (check->isfree)
continue; continue;
if (check->v->movetype == MOVETYPE_PUSH if (check->v->movetype == MOVETYPE_PUSH
|| check->v->movetype == MOVETYPE_NONE || check->v->movetype == MOVETYPE_NONE
|| check->v->movetype == MOVETYPE_NOCLIP) || check->v->movetype == MOVETYPE_NOCLIP)
@ -567,7 +568,7 @@ qboolean SV_PushAngles (edict_t *pusher, vec3_t move, vec3_t amove)
|| check->v->absmax[1] <= mins[1] || check->v->absmax[1] <= mins[1]
|| check->v->absmax[2] <= mins[2] ) || check->v->absmax[2] <= mins[2] )
continue; continue;
// see if the ent's bbox is inside the pusher's final position // see if the ent's bbox is inside the pusher's final position
if (!SV_TestEntityPosition (check)) if (!SV_TestEntityPosition (check))
@ -582,7 +583,7 @@ qboolean SV_PushAngles (edict_t *pusher, vec3_t move, vec3_t amove)
VectorCopy (check->v->angles, pushed_p->angles); VectorCopy (check->v->angles, pushed_p->angles);
pushed_p++; pushed_p++;
// try moving the contacted entity // try moving the contacted entity
VectorAdd (check->v->origin, move, check->v->origin); VectorAdd (check->v->origin, move, check->v->origin);
// if (check->client) // if (check->client)
// { // FIXME: doesn't rotate monsters? // { // FIXME: doesn't rotate monsters?
@ -598,6 +599,8 @@ qboolean SV_PushAngles (edict_t *pusher, vec3_t move, vec3_t amove)
VectorSubtract (org2, org, move2); VectorSubtract (org2, org, move2);
VectorAdd (check->v->origin, move2, check->v->origin); VectorAdd (check->v->origin, move2, check->v->origin);
check->v->flags = (int)check->v->flags & ~FL_ONGROUND;
// may have pushed them off an edge // may have pushed them off an edge
if (PROG_TO_EDICT(svprogfuncs, check->v->groundentity) != pusher) if (PROG_TO_EDICT(svprogfuncs, check->v->groundentity) != pusher)
check->v->groundentity = 0; check->v->groundentity = 0;
@ -630,7 +633,7 @@ qboolean SV_PushAngles (edict_t *pusher, vec3_t move, vec3_t amove)
SV_LinkEdict (check, false); SV_LinkEdict (check, false);
continue; continue;
} }
// Con_Printf("Pusher hit %s\n", PR_GetString(svprogfuncs, check->v->classname)); // Con_Printf("Pusher hit %s\n", PR_GetString(svprogfuncs, check->v->classname));
if (pusher->v->blocked) if (pusher->v->blocked)
{ {
@ -692,7 +695,7 @@ qboolean SV_Push (edict_t *pusher, vec3_t move, vec3_t amove)
} }
VectorCopy (pusher->v->origin, pushorig); VectorCopy (pusher->v->origin, pushorig);
// move the pusher to it's final position // move the pusher to it's final position
VectorAdd (pusher->v->origin, move, pusher->v->origin); VectorAdd (pusher->v->origin, move, pusher->v->origin);
@ -720,7 +723,7 @@ qboolean SV_Push (edict_t *pusher, vec3_t move, vec3_t amove)
// if the entity is standing on the pusher, it will definately be moved // if the entity is standing on the pusher, it will definately be moved
if ( ! ( ((int)check->v->flags & FL_ONGROUND) if ( ! ( ((int)check->v->flags & FL_ONGROUND)
&& &&
PROG_TO_EDICT(svprogfuncs, check->v->groundentity) == pusher) ) PROG_TO_EDICT(svprogfuncs, check->v->groundentity) == pusher) )
{ {
if ( check->v->absmin[0] >= maxs[0] if ( check->v->absmin[0] >= maxs[0]
@ -740,7 +743,9 @@ qboolean SV_Push (edict_t *pusher, vec3_t move, vec3_t amove)
moved_edict[num_moved] = check; moved_edict[num_moved] = check;
num_moved++; num_moved++;
// try moving the contacted entity check->v->flags = (int)check->v->flags & ~FL_ONGROUND;
// try moving the contacted entity
VectorAdd (check->v->origin, move, check->v->origin); VectorAdd (check->v->origin, move, check->v->origin);
block = SV_TestEntityPosition (check); block = SV_TestEntityPosition (check);
if (!block) if (!block)
@ -771,7 +776,7 @@ qboolean SV_Push (edict_t *pusher, vec3_t move, vec3_t amove)
SV_LinkEdict (check, false); SV_LinkEdict (check, false);
continue; continue;
} }
VectorCopy (pushorig, pusher->v->origin); VectorCopy (pushorig, pusher->v->origin);
SV_LinkEdict (pusher, false); SV_LinkEdict (pusher, false);
@ -783,7 +788,7 @@ qboolean SV_Push (edict_t *pusher, vec3_t move, vec3_t amove)
pr_global_struct->other = EDICT_TO_PROG(svprogfuncs, check); pr_global_struct->other = EDICT_TO_PROG(svprogfuncs, check);
PR_ExecuteProgram (svprogfuncs, pusher->v->blocked); PR_ExecuteProgram (svprogfuncs, pusher->v->blocked);
} }
// move back any entities we already moved // move back any entities we already moved
for (i=0 ; i<num_moved ; i++) for (i=0 ; i<num_moved ; i++)
{ {
@ -843,7 +848,7 @@ vec3_t oldang, amove;
float l; float l;
oldltime = ent->v->ltime; oldltime = ent->v->ltime;
thinktime = ent->v->nextthink; thinktime = ent->v->nextthink;
if (thinktime < ent->v->ltime + host_frametime) if (thinktime < ent->v->ltime + host_frametime)
{ {
@ -858,7 +863,7 @@ float l;
{ {
SV_PushMove (ent, movetime); // advances ent->v->ltime if not blocked SV_PushMove (ent, movetime); // advances ent->v->ltime if not blocked
} }
if (thinktime > oldltime && thinktime <= ent->v->ltime) if (thinktime > oldltime && thinktime <= ent->v->ltime)
{ {
VectorCopy (ent->v->origin, oldorg); VectorCopy (ent->v->origin, oldorg);
@ -942,7 +947,7 @@ void SV_Physics_Noclip (edict_t *ent)
// regular thinking // regular thinking
if (!SV_RunThink (ent)) if (!SV_RunThink (ent))
return; return;
VectorMA (ent->v->angles, host_frametime, ent->v->avelocity, ent->v->angles); VectorMA (ent->v->angles, host_frametime, ent->v->avelocity, ent->v->angles);
VectorMA (ent->v->origin, host_frametime, ent->v->velocity, ent->v->origin); VectorMA (ent->v->origin, host_frametime, ent->v->velocity, ent->v->origin);
@ -985,13 +990,13 @@ void SV_CheckWaterTransition (edict_t *ent)
ent->v->waterlevel = 1; ent->v->waterlevel = 1;
return; return;
} }
if (cont <= Q1CONTENTS_WATER) if (cont <= Q1CONTENTS_WATER)
{ {
if (ent->v->watertype == Q1CONTENTS_EMPTY) if (ent->v->watertype == Q1CONTENTS_EMPTY)
{ // just crossed into water { // just crossed into water
SV_StartSound (ent, 0, "misc/h2ohit1.wav", 255, 1); SV_StartSound (ent, 0, "misc/h2ohit1.wav", 255, 1);
} }
ent->v->watertype = cont; ent->v->watertype = cont;
ent->v->waterlevel = 1; ent->v->waterlevel = 1;
} }
@ -1000,7 +1005,7 @@ void SV_CheckWaterTransition (edict_t *ent)
if (ent->v->watertype != Q1CONTENTS_EMPTY) if (ent->v->watertype != Q1CONTENTS_EMPTY)
{ // just crossed into open { // just crossed into open
SV_StartSound (ent, 0, "misc/h2ohit1.wav", 255, 1); SV_StartSound (ent, 0, "misc/h2ohit1.wav", 255, 1);
} }
ent->v->watertype = Q1CONTENTS_EMPTY; ent->v->watertype = Q1CONTENTS_EMPTY;
ent->v->waterlevel = cont; ent->v->waterlevel = cont;
} }
@ -1027,12 +1032,24 @@ void SV_Physics_Toss (edict_t *ent)
if (!SV_RunThink (ent)) if (!SV_RunThink (ent))
return; return;
if (ent->v->velocity[2] > 0)
ent->v->flags = (int)ent->v->flags & ~FL_ONGROUND;
// if onground, return without moving // if onground, return without moving
if ( ((int)ent->v->flags & FL_ONGROUND) ) if ( ((int)ent->v->flags & FL_ONGROUND) )
return; {
if (ent->v->velocity[2] > 0)
ent->v->flags = (int)ent->v->flags & ~FL_ONGROUND;
else if (ent->v->groundentity)
{
if (sv_gameplayfix_noairborncorpse.value)
{
edict_t *onent;
onent = PROG_TO_EDICT(svprogfuncs, ent->v->groundentity);
if (!onent->isfree)
return; //don't drop if our fround is still valid
}
else
return; //don't drop, even if the item we were on was removed (certain dm maps do this for q3 style stuff).
}
}
// add gravity // add gravity
if (ent->v->movetype != MOVETYPE_FLY if (ent->v->movetype != MOVETYPE_FLY
@ -1058,7 +1075,7 @@ void SV_Physics_Toss (edict_t *ent)
return; return;
VectorCopy(trace.endpos, move); VectorCopy(trace.endpos, move);
if (ent->v->movetype == MOVETYPE_BOUNCE) if (ent->v->movetype == MOVETYPE_BOUNCE)
backoff = 1.5; backoff = 1.5;
else if (ent->v->movetype == MOVETYPE_BOUNCEMISSILE) else if (ent->v->movetype == MOVETYPE_BOUNCEMISSILE)
@ -1071,7 +1088,7 @@ void SV_Physics_Toss (edict_t *ent)
// stop if on ground // stop if on ground
if ((trace.plane.normal[2] > 0.7) && (ent->v->movetype != MOVETYPE_BOUNCEMISSILE)) if ((trace.plane.normal[2] > 0.7) && (ent->v->movetype != MOVETYPE_BOUNCEMISSILE))
{ {
if (ent->v->velocity[2] < 60 || ent->v->movetype != MOVETYPE_BOUNCE ) if (ent->v->velocity[2] < 60 || ent->v->movetype != MOVETYPE_BOUNCE )
{ {
ent->v->flags = (int)ent->v->flags | FL_ONGROUND; ent->v->flags = (int)ent->v->flags | FL_ONGROUND;
@ -1080,7 +1097,7 @@ void SV_Physics_Toss (edict_t *ent)
VectorCopy (vec3_origin, ent->v->avelocity); VectorCopy (vec3_origin, ent->v->avelocity);
} }
} }
// check for in water // check for in water
SV_CheckWaterTransition (ent); SV_CheckWaterTransition (ent);
} }
@ -1136,7 +1153,7 @@ void SV_Physics_Step (edict_t *ent)
// regular thinking // regular thinking
SV_RunThink (ent); SV_RunThink (ent);
SV_CheckWaterTransition (ent); SV_CheckWaterTransition (ent);
} }
@ -1192,7 +1209,7 @@ void SV_CheckStuck (edict_t *ent)
SV_LinkEdict (ent, true); SV_LinkEdict (ent, true);
return; return;
} }
for (z=0 ; z < pm_stepheight ; z++) for (z=0 ; z < pm_stepheight ; z++)
for (i=-1 ; i <= 1 ; i++) for (i=-1 ; i <= 1 ; i++)
for (j=-1 ; j <= 1 ; j++) for (j=-1 ; j <= 1 ; j++)
@ -1207,7 +1224,7 @@ void SV_CheckStuck (edict_t *ent)
return; return;
} }
} }
VectorCopy (org, ent->v->origin); VectorCopy (org, ent->v->origin);
Con_DPrintf ("player is stuck.\n"); Con_DPrintf ("player is stuck.\n");
} }
@ -1224,7 +1241,7 @@ qboolean SV_CheckWater (edict_t *ent)
point[0] = ent->v->origin[0]; point[0] = ent->v->origin[0];
point[1] = ent->v->origin[1]; point[1] = ent->v->origin[1];
point[2] = ent->v->origin[2] + ent->v->mins[2] + 1; point[2] = ent->v->origin[2] + ent->v->mins[2] + 1;
ent->v->waterlevel = 0; ent->v->waterlevel = 0;
ent->v->watertype = Q1CONTENTS_EMPTY; ent->v->watertype = Q1CONTENTS_EMPTY;
@ -1237,7 +1254,7 @@ qboolean SV_CheckWater (edict_t *ent)
ent->v->watertype = Q1CONTENTS_SLIME; ent->v->watertype = Q1CONTENTS_SLIME;
else if (cont & FTECONTENTS_WATER) else if (cont & FTECONTENTS_WATER)
ent->v->watertype = Q1CONTENTS_WATER; ent->v->watertype = Q1CONTENTS_WATER;
else else
ent->v->watertype = Q1CONTENTS_SKY; ent->v->watertype = Q1CONTENTS_SKY;
ent->v->waterlevel = 1; ent->v->waterlevel = 1;
point[2] = ent->v->origin[2] + (ent->v->mins[2] + ent->v->maxs[2])*0.5; point[2] = ent->v->origin[2] + (ent->v->mins[2] + ent->v->maxs[2])*0.5;
@ -1251,7 +1268,7 @@ qboolean SV_CheckWater (edict_t *ent)
ent->v->waterlevel = 3; ent->v->waterlevel = 3;
} }
} }
return ent->v->waterlevel > 1; return ent->v->waterlevel > 1;
} }
@ -1267,19 +1284,19 @@ void SV_WallFriction (edict_t *ent, trace_t *trace)
vec3_t forward, right, up; vec3_t forward, right, up;
float d, i; float d, i;
vec3_t into, side; vec3_t into, side;
AngleVectors (ent->v->v_angle, forward, right, up); AngleVectors (ent->v->v_angle, forward, right, up);
d = DotProduct (trace->plane.normal, forward); d = DotProduct (trace->plane.normal, forward);
d += 0.5; d += 0.5;
if (d >= 0 || IS_NAN(d)) if (d >= 0 || IS_NAN(d))
return; return;
// cut the tangential velocity // cut the tangential velocity
i = DotProduct (trace->plane.normal, ent->v->velocity); i = DotProduct (trace->plane.normal, ent->v->velocity);
VectorScale (trace->plane.normal, i, into); VectorScale (trace->plane.normal, i, into);
VectorSubtract (ent->v->velocity, into, side); VectorSubtract (ent->v->velocity, into, side);
ent->v->velocity[0] = side[0] * (1 + d); ent->v->velocity[0] = side[0] * (1 + d);
ent->v->velocity[1] = side[1] * (1 + d); ent->v->velocity[1] = side[1] * (1 + d);
} }
@ -1303,7 +1320,7 @@ int SV_TryUnstick (edict_t *ent, vec3_t oldvel)
vec3_t dir; vec3_t dir;
int clip; int clip;
trace_t steptrace; trace_t steptrace;
VectorCopy (ent->v->origin, oldorg); VectorCopy (ent->v->origin, oldorg);
VectorCopy (vec3_origin, dir); VectorCopy (vec3_origin, dir);
@ -1321,7 +1338,7 @@ int SV_TryUnstick (edict_t *ent, vec3_t oldvel)
case 6: dir[0] = 2; dir[1] = -2; break; case 6: dir[0] = 2; dir[1] = -2; break;
case 7: dir[0] = -2; dir[1] = -2; break; case 7: dir[0] = -2; dir[1] = -2; break;
} }
SV_PushEntity (ent, dir); SV_PushEntity (ent, dir);
// retry the original move // retry the original move
@ -1336,11 +1353,11 @@ int SV_TryUnstick (edict_t *ent, vec3_t oldvel)
//Con_DPrintf ("unstuck!\n"); //Con_DPrintf ("unstuck!\n");
return clip; return clip;
} }
// go back to the original pos and try again // go back to the original pos and try again
VectorCopy (oldorg, ent->v->origin); VectorCopy (oldorg, ent->v->origin);
} }
VectorCopy (vec3_origin, ent->v->velocity); VectorCopy (vec3_origin, ent->v->velocity);
return 7; // still not moving return 7; // still not moving
} }
@ -1362,16 +1379,16 @@ void SV_WalkMove (edict_t *ent)
int clip; int clip;
int oldonground; int oldonground;
trace_t steptrace, downtrace; trace_t steptrace, downtrace;
// //
// do a regular slide move unless it looks like you ran into a step // do a regular slide move unless it looks like you ran into a step
// //
oldonground = (int)ent->v->flags & FL_ONGROUND; oldonground = (int)ent->v->flags & FL_ONGROUND;
ent->v->flags = (int)ent->v->flags & ~FL_ONGROUND; ent->v->flags = (int)ent->v->flags & ~FL_ONGROUND;
VectorCopy (ent->v->origin, oldorg); VectorCopy (ent->v->origin, oldorg);
VectorCopy (ent->v->velocity, oldvel); VectorCopy (ent->v->velocity, oldvel);
clip = SV_FlyMove (ent, host_frametime, &steptrace); clip = SV_FlyMove (ent, host_frametime, &steptrace);
if ( !(clip & 2) ) if ( !(clip & 2) )
@ -1379,13 +1396,13 @@ void SV_WalkMove (edict_t *ent)
if (!oldonground && ent->v->waterlevel == 0) if (!oldonground && ent->v->waterlevel == 0)
return; // don't stair up while jumping return; // don't stair up while jumping
if (ent->v->movetype != MOVETYPE_WALK) if (ent->v->movetype != MOVETYPE_WALK)
return; // gibbed by a trigger return; // gibbed by a trigger
// if (sv_nostep.value) // if (sv_nostep.value)
// return; // return;
if ( (int)ent->v->flags & FL_WATERJUMP ) if ( (int)ent->v->flags & FL_WATERJUMP )
return; return;
@ -1423,7 +1440,7 @@ void SV_WalkMove (edict_t *ent)
// Con_Printf("Try unstick fwd\n"); // Con_Printf("Try unstick fwd\n");
} }
} }
// extra friction based on view angle // extra friction based on view angle
if ( clip & 2 ) if ( clip & 2 )
{ {
@ -1502,7 +1519,7 @@ void SV_WalkMove (edict_t *ent)
{ {
// if the push down didn't end up on good ground, use the move without // if the push down didn't end up on good ground, use the move without
// the step up. This happens near wall / slope combinations, and can // the step up. This happens near wall / slope combinations, and can
// cause the player to hop up higher on a slope too steep to climb // cause the player to hop up higher on a slope too steep to climb
VectorCopy (nosteporg, ent->v->origin); VectorCopy (nosteporg, ent->v->origin);
VectorCopy (nostepvel, ent->v->velocity); VectorCopy (nostepvel, ent->v->velocity);
@ -1562,31 +1579,31 @@ void SV_WalkMove (edict_t *ent)
// if (sv_nostep.value) // if (sv_nostep.value)
// return; // return;
// if move didn't block on a step, return // if move didn't block on a step, return
if (clip & 2) if (clip & 2)
{ {
// if move was not trying to move into the step, return // if move was not trying to move into the step, return
if (fabs(start_velocity[0]) < 0.03125 && fabs(start_velocity[1]) < 0.03125) if (fabs(start_velocity[0]) < 0.03125 && fabs(start_velocity[1]) < 0.03125)
return; return;
if (ent->v->movetype != MOVETYPE_FLY) if (ent->v->movetype != MOVETYPE_FLY)
{ {
// return if gibbed by a trigger // return if gibbed by a trigger
if (ent->v->movetype != MOVETYPE_WALK) if (ent->v->movetype != MOVETYPE_WALK)
return; return;
// only step up while jumping if that is enabled // only step up while jumping if that is enabled
// if (!(sv_jumpstep.value && sv_gameplayfix_stepwhilejumping.value)) // if (!(sv_jumpstep.value && sv_gameplayfix_stepwhilejumping.value))
if (!oldonground && ent->v->waterlevel == 0) if (!oldonground && ent->v->waterlevel == 0)
return; return;
} }
// try moving up and forward to go up a step // try moving up and forward to go up a step
// back to start pos // back to start pos
VectorCopy (start_origin, ent->v->origin); VectorCopy (start_origin, ent->v->origin);
VectorCopy (start_velocity, ent->v->velocity); VectorCopy (start_velocity, ent->v->velocity);
// move up // move up
VectorClear (upmove); VectorClear (upmove);
upmove[2] = pm_stepheight; upmove[2] = pm_stepheight;
@ -1597,9 +1614,9 @@ void SV_WalkMove (edict_t *ent)
ent->v->velocity[2] = 0; ent->v->velocity[2] = 0;
clip = SV_FlyMove (ent, host_frametime, &steptrace); clip = SV_FlyMove (ent, host_frametime, &steptrace);
ent->v->velocity[2] += start_velocity[2]; ent->v->velocity[2] += start_velocity[2];
SV_CheckVelocity(ent); SV_CheckVelocity(ent);
// check for stuckness, possibly due to the limited precision of floats // check for stuckness, possibly due to the limited precision of floats
// in the clipping hulls // in the clipping hulls
if (clip if (clip
@ -1612,7 +1629,7 @@ void SV_WalkMove (edict_t *ent)
VectorCopy(originalmove_velocity, ent->v->velocity); VectorCopy(originalmove_velocity, ent->v->velocity);
//clip = originalmove_clip; //clip = originalmove_clip;
ent->v->flags = originalmove_flags; ent->v->flags = originalmove_flags;
ent->v->groundentity = originalmove_groundentity; ent->v->groundentity = originalmove_groundentity;
// now try to unstick if needed // now try to unstick if needed
//clip = SV_TryUnstick (ent, oldvel); //clip = SV_TryUnstick (ent, oldvel);
return; return;
@ -1656,7 +1673,7 @@ void SV_WalkMove (edict_t *ent)
VectorCopy(originalmove_velocity, ent->v->velocity); VectorCopy(originalmove_velocity, ent->v->velocity);
//clip = originalmove_clip; //clip = originalmove_clip;
ent->v->flags = originalmove_flags; ent->v->flags = originalmove_flags;
ent->v->groundentity = originalmove_groundentity; ent->v->groundentity = originalmove_groundentity;
} }
SV_SetOnGround (ent); SV_SetOnGround (ent);
@ -1696,12 +1713,12 @@ void SV_RunEntity (edict_t *ent)
// //
// call standard client pre-think // call standard client pre-think
// //
pr_global_struct->time = sv.time; pr_global_struct->time = sv.time;
pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, ent); pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, ent);
if (pr_global_struct->PlayerPreThink) if (pr_global_struct->PlayerPreThink)
PR_ExecuteProgram (svprogfuncs, pr_global_struct->PlayerPreThink); PR_ExecuteProgram (svprogfuncs, pr_global_struct->PlayerPreThink);
if (readyforjump) //qw progs can't jump for themselves... if (readyforjump) //qw progs can't jump for themselves...
{ {
if (!ent->v->button2 && !((int)ent->v->flags & FL_JUMPRELEASED) && ent->v->velocity[2] <= 0) if (!ent->v->button2 && !((int)ent->v->flags & FL_JUMPRELEASED) && ent->v->velocity[2] <= 0)
@ -1826,9 +1843,9 @@ void SV_RunNewmis (void)
ent = PROG_TO_EDICT(svprogfuncs, pr_global_struct->newmis); ent = PROG_TO_EDICT(svprogfuncs, pr_global_struct->newmis);
host_frametime = 0.05; host_frametime = 0.05;
pr_global_struct->newmis = 0; pr_global_struct->newmis = 0;
SV_RunEntity (ent); SV_RunEntity (ent);
host_frametime = pr_global_struct->frametime; host_frametime = pr_global_struct->frametime;
} }
@ -1981,9 +1998,9 @@ qboolean SV_Physics (void)
SV_RunEntity (ent); SV_RunEntity (ent);
SV_RunNewmis (); SV_RunNewmis ();
} }
if (retouch) if (retouch)
pr_global_struct->force_retouch-=1; pr_global_struct->force_retouch-=1;
if (EndFrameQC) if (EndFrameQC)
{ {
@ -1999,15 +2016,15 @@ qboolean SV_Physics (void)
void SV_SetMoveVars(void) void SV_SetMoveVars(void)
{ {
movevars.gravity = sv_gravity.value; movevars.gravity = sv_gravity.value;
movevars.stopspeed = sv_stopspeed.value; movevars.stopspeed = sv_stopspeed.value;
movevars.maxspeed = sv_maxspeed.value; movevars.maxspeed = sv_maxspeed.value;
movevars.spectatormaxspeed = sv_spectatormaxspeed.value; movevars.spectatormaxspeed = sv_spectatormaxspeed.value;
movevars.accelerate = sv_accelerate.value; movevars.accelerate = sv_accelerate.value;
movevars.airaccelerate = sv_airaccelerate.value; movevars.airaccelerate = sv_airaccelerate.value;
movevars.wateraccelerate = sv_wateraccelerate.value; movevars.wateraccelerate = sv_wateraccelerate.value;
movevars.friction = sv_friction.value; movevars.friction = sv_friction.value;
movevars.waterfriction = sv_waterfriction.value; movevars.waterfriction = sv_waterfriction.value;
movevars.entgravity = 1.0; movevars.entgravity = 1.0;
} }
#endif #endif

View file

@ -558,6 +558,9 @@ void SV_MulticastProtExt(vec3_t origin, multicast_t to, int dimension_mask, int
case SCP_BAD: case SCP_BAD:
continue; //a bot. continue; //a bot.
default:
SV_Error("Multicast: Client is using a bad protocl");
#ifdef NQPROT #ifdef NQPROT
case SCP_NETQUAKE: case SCP_NETQUAKE:
case SCP_DARKPLACES6: case SCP_DARKPLACES6:
@ -672,6 +675,8 @@ void SV_MulticastProtExt(vec3_t origin, multicast_t to, int dimension_mask, int
{ {
case SCP_BAD: case SCP_BAD:
continue; //a bot. continue; //a bot.
default:
SV_Error("multicast: Client is using a bad protocol");
#ifdef NQPROT #ifdef NQPROT
case SCP_NETQUAKE: case SCP_NETQUAKE:

View file

@ -348,7 +348,6 @@ void SVNQ_New_f (void)
#ifdef Q2SERVER #ifdef Q2SERVER
void SVQ2_ConfigStrings_f (void) void SVQ2_ConfigStrings_f (void)
{ {
extern int map_checksum;
int start; int start;
char *str; char *str;
@ -447,6 +446,7 @@ void SVQ2_ConfigStrings_f (void)
} }
else if (start < Q2CS_MODELS) else if (start < Q2CS_MODELS)
{ {
extern int map_checksum;
MSG_WriteByte (&host_client->netchan.message, svcq2_configstring); MSG_WriteByte (&host_client->netchan.message, svcq2_configstring);
MSG_WriteShort (&host_client->netchan.message, start); MSG_WriteShort (&host_client->netchan.message, start);
MSG_WriteString (&host_client->netchan.message, va("%i", map_checksum)); MSG_WriteString (&host_client->netchan.message, va("%i", map_checksum));
@ -3993,7 +3993,6 @@ void SV_RunCmd (usercmd_t *ucmd, qboolean recurse)
int oldmsec; int oldmsec;
double tmp_time; double tmp_time;
qboolean jumpable; qboolean jumpable;
extern cvar_t sv_gravity;
// DMW copied this KK hack copied from QuakeForge anti-cheat // DMW copied this KK hack copied from QuakeForge anti-cheat