2 Copyright (C) 1996-1997 Id Software, Inc.
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 See the GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 // cl_main.c -- client main loop
23 #include "cl_collision.h"
25 // we need to declare some mouse variables here, because the menu system
26 // references them even when on a unix system.
28 // these two are not intended to be set directly
29 cvar_t cl_name = {CVAR_SAVE, "_cl_name", "player"};
30 cvar_t cl_color = {CVAR_SAVE, "_cl_color", "0"};
31 cvar_t cl_pmodel = {CVAR_SAVE, "_cl_pmodel", "0"};
33 cvar_t cl_shownet = {0, "cl_shownet","0"};
34 cvar_t cl_nolerp = {0, "cl_nolerp", "0"};
36 cvar_t cl_itembobheight = {0, "cl_itembobheight", "8"};
37 cvar_t cl_itembobspeed = {0, "cl_itembobspeed", "0.5"};
39 cvar_t lookspring = {CVAR_SAVE, "lookspring","0"};
40 cvar_t lookstrafe = {CVAR_SAVE, "lookstrafe","0"};
41 cvar_t sensitivity = {CVAR_SAVE, "sensitivity","3", 1, 30};
43 cvar_t m_pitch = {CVAR_SAVE, "m_pitch","0.022"};
44 cvar_t m_yaw = {CVAR_SAVE, "m_yaw","0.022"};
45 cvar_t m_forward = {CVAR_SAVE, "m_forward","1"};
46 cvar_t m_side = {CVAR_SAVE, "m_side","0.8"};
48 cvar_t freelook = {CVAR_SAVE, "freelook", "1"};
50 cvar_t cl_draweffects = {0, "cl_draweffects", "1"};
52 mempool_t *cl_scores_mempool;
53 mempool_t *cl_refdef_mempool;
57 // FIXME: put these on hunk?
58 entity_t cl_entities[MAX_EDICTS];
59 entity_t cl_static_entities[MAX_STATIC_ENTITIES];
60 lightstyle_t cl_lightstyle[MAX_LIGHTSTYLES];
62 typedef struct effect_s
71 // these are for interpolation
78 #define MAX_EFFECTS 256
80 static cl_effect_t cl_effect[MAX_EFFECTS];
89 void CL_ClearState (void)
96 Mem_EmptyPool(cl_scores_mempool);
98 // wipe the entire cl structure
99 memset (&cl, 0, sizeof(cl));
101 SZ_Clear (&cls.message);
103 // clear other arrays
104 memset(cl_entities, 0, sizeof(cl_entities));
105 memset(cl_lightstyle, 0, sizeof(cl_lightstyle));
106 memset(cl_temp_entities, 0, sizeof(cl_temp_entities));
107 memset(cl_beams, 0, sizeof(cl_beams));
108 memset(cl_dlights, 0, sizeof(cl_dlights));
109 memset(cl_effect, 0, sizeof(cl_effect));
111 CL_Particles_Clear();
112 // LordHavoc: have to set up the baseline info for alpha and other stuff
113 for (i = 0;i < MAX_EDICTS;i++)
115 ClearStateToDefault(&cl_entities[i].state_baseline);
116 ClearStateToDefault(&cl_entities[i].state_previous);
117 ClearStateToDefault(&cl_entities[i].state_current);
123 void CL_LerpUpdate(entity_t *e)
125 entity_persistent_t *p;
130 if (p->modelindex != e->state_current.modelindex)
132 // reset all interpolation information
133 p->modelindex = e->state_current.modelindex;
134 p->frame1 = p->frame2 = e->state_current.frame;
135 p->frame1time = p->frame2time = cl.time;
138 else if (p->frame2 != e->state_current.frame)
140 // transition to new frame
141 p->frame1 = p->frame2;
142 p->frame1time = p->frame2time;
143 p->frame2 = e->state_current.frame;
144 p->frame2time = cl.time;
150 p->framelerp = (cl.time - p->frame2time) * 10;
151 p->framelerp = bound(0, p->framelerp, 1);
154 r->model = cl.model_precache[e->state_current.modelindex];
155 Mod_CheckLoaded(r->model);
156 r->frame = e->state_current.frame;
157 r->frame1 = p->frame1;
158 r->frame2 = p->frame2;
159 r->framelerp = p->framelerp;
160 r->frame1time = p->frame1time;
161 r->frame2time = p->frame2time;
165 =====================
168 Sends a disconnect message to the server
169 This is also called on Host_Error, so it shouldn't cause any errors
170 =====================
172 void CL_Disconnect (void)
174 if (cls.state == ca_dedicated)
177 // stop sounds (especially looping!)
178 S_StopAllSounds (true);
180 // clear contents blends
181 cl.cshifts[0].percent = 0;
182 cl.cshifts[1].percent = 0;
183 cl.cshifts[2].percent = 0;
184 cl.cshifts[3].percent = 0;
186 cl.worldmodel = NULL;
188 if (cls.demoplayback)
190 else if (cls.state == ca_connected)
192 if (cls.demorecording)
195 Con_DPrintf ("Sending clc_disconnect\n");
196 SZ_Clear (&cls.message);
197 MSG_WriteByte (&cls.message, clc_disconnect);
198 NET_SendUnreliableMessage (cls.netcon, &cls.message);
199 SZ_Clear (&cls.message);
200 NET_Close (cls.netcon);
201 cls.state = ca_disconnected; // prevent this code from executing again during Host_ShutdownServer
202 // if running a local server, shut it down
204 Host_ShutdownServer(false);
206 cls.state = ca_disconnected;
208 cls.demoplayback = cls.timedemo = false;
212 void CL_Disconnect_f (void)
216 Host_ShutdownServer (false);
223 =====================
224 CL_EstablishConnection
226 Host should be either "local" or a net address to be passed on
227 =====================
229 void CL_EstablishConnection (char *host)
231 if (cls.state == ca_dedicated)
234 if (cls.demoplayback)
239 cls.netcon = NET_Connect (host);
241 Host_Error ("CL_Connect: connect failed\n");
242 Con_DPrintf ("CL_EstablishConnection: connected to %s\n", host);
244 cls.demonum = -1; // not in the demo loop now
245 cls.state = ca_connected;
246 cls.signon = 0; // need all the signon messages before playing
256 static void CL_PrintEntities_f (void)
262 for (i = 0, ent = cl_entities;i < MAX_EDICTS /*cl.num_entities*/;i++, ent++)
264 if (!ent->state_current.active)
266 if (!ent->render.model)
269 Con_Printf ("%3i:", i);
270 if (!ent->render.model)
272 Con_Printf ("EMPTY\n");
275 strncpy(name, ent->render.model->name, 25);
277 for (j = strlen(name);j < 25;j++)
279 Con_Printf ("%s:%04i (%5i %5i %5i) [%3i %3i %3i] %4.2f %5.3f\n", name, ent->render.frame, (int) ent->render.origin[0], (int) ent->render.origin[1], (int) ent->render.origin[2], (int) ent->render.angles[0] % 360, (int) ent->render.angles[1] % 360, (int) ent->render.angles[2] % 360, ent->render.scale, ent->render.alpha);
288 Determines the fraction between the last two messages that the objects
292 static float CL_LerpPoint (void)
296 // dropped packet, or start of demo
297 if (cl.mtime[1] < cl.mtime[0] - 0.1)
298 cl.mtime[1] = cl.mtime[0] - 0.1;
300 cl.time = bound(cl.mtime[1], cl.time, cl.mtime[0]);
302 // LordHavoc: lerp in listen games as the server is being capped below the client (usually)
303 f = cl.mtime[0] - cl.mtime[1];
304 if (!f || cl_nolerp.integer || cls.timedemo || (sv.active && svs.maxclients == 1))
306 cl.time = cl.mtime[0];
310 f = (cl.time - cl.mtime[1]) / f;
311 return bound(0, f, 1);
314 static void CL_RelinkStaticEntities(void)
317 for (i = 0;i < cl.num_statics && r_refdef.numentities < MAX_VISEDICTS;i++)
319 Mod_CheckLoaded(cl_static_entities[i].render.model);
320 r_refdef.entities[r_refdef.numentities++] = &cl_static_entities[i].render;
329 static void CL_RelinkNetworkEntities()
332 int i, glowcolor, effects;
333 float f, d, bobjrotate, bobjoffset, dlightradius, glowsize, lerp;
334 vec3_t oldorg, neworg, delta, dlightcolor;
336 bobjrotate = ANGLEMOD(100*cl.time);
337 if (cl_itembobheight.value)
338 bobjoffset = (cos(cl.time * cl_itembobspeed.value * (2.0 * M_PI)) + 1.0) * 0.5 * cl_itembobheight.value;
342 // start on the entity after the world
343 for (i = 1, ent = cl_entities + 1;i < MAX_EDICTS /*cl.num_entities*/;i++, ent++)
345 // if the object wasn't included in the latest packet, remove it
346 if (!ent->state_current.active)
349 VectorCopy(ent->persistent.trail_origin, oldorg);
351 if (!ent->state_previous.active)
353 // only one state available
355 VectorCopy (ent->state_current.origin, oldorg); // skip trails
356 VectorCopy (ent->state_current.origin, neworg);
357 VectorCopy (ent->state_current.angles, ent->render.angles);
361 // if the delta is large, assume a teleport and don't lerp
362 VectorSubtract(ent->state_current.origin, ent->state_previous.origin, delta);
363 // LordHavoc: increased tolerance from 100 to 200, and now to 1000
364 if ((sv.active && svs.maxclients == 1 && !(ent->state_current.flags & RENDER_STEP)) || cls.timedemo || DotProduct(delta, delta) > 1000*1000 || cl_nolerp.integer)
368 f = ent->state_current.time - ent->state_previous.time;
370 lerp = (cl.time - ent->state_previous.time) / f;
377 VectorCopy (ent->state_current.origin, neworg);
378 VectorCopy (ent->state_current.angles, ent->render.angles);
382 // interpolate the origin and angles
383 VectorMA(ent->state_previous.origin, lerp, delta, neworg);
384 VectorSubtract(ent->state_current.angles, ent->state_previous.angles, delta);
385 if (delta[0] < -180) delta[0] += 360;else if (delta[0] >= 180) delta[0] -= 360;
386 if (delta[1] < -180) delta[1] += 360;else if (delta[1] >= 180) delta[1] -= 360;
387 if (delta[2] < -180) delta[2] += 360;else if (delta[2] >= 180) delta[2] -= 360;
388 VectorMA(ent->state_previous.angles, lerp, delta, ent->render.angles);
392 VectorCopy (neworg, ent->persistent.trail_origin);
393 // persistent.modelindex will be updated by CL_LerpUpdate
394 if (ent->state_current.modelindex != ent->persistent.modelindex)
395 VectorCopy(neworg, oldorg);
397 VectorCopy (neworg, ent->render.origin);
398 ent->render.flags = ent->state_current.flags;
399 ent->render.effects = effects = ent->state_current.effects;
400 if (cl.scores == NULL || !ent->state_current.colormap)
401 ent->render.colormap = -1; // no special coloring
403 ent->render.colormap = cl.scores[ent->state_current.colormap - 1].colors; // color it
404 ent->render.skinnum = ent->state_current.skin;
405 ent->render.alpha = ent->state_current.alpha * (1.0f / 255.0f); // FIXME: interpolate?
406 ent->render.scale = ent->state_current.scale * (1.0f / 16.0f); // FIXME: interpolate?
408 // update interpolation info
411 // handle effects now...
417 // LordHavoc: if the entity has no effects, don't check each
420 if (effects & EF_BRIGHTFIELD)
421 CL_EntityParticles (ent);
422 if (effects & EF_MUZZLEFLASH)
423 ent->persistent.muzzleflash = 100.0f;
424 if (effects & EF_DIMLIGHT)
426 dlightcolor[0] += 200.0f;
427 dlightcolor[1] += 200.0f;
428 dlightcolor[2] += 200.0f;
430 if (effects & EF_BRIGHTLIGHT)
432 dlightcolor[0] += 400.0f;
433 dlightcolor[1] += 400.0f;
434 dlightcolor[2] += 400.0f;
436 // LordHavoc: added EF_RED and EF_BLUE
437 if (effects & EF_RED) // red
439 dlightcolor[0] += 200.0f;
440 dlightcolor[1] += 20.0f;
441 dlightcolor[2] += 20.0f;
443 if (effects & EF_BLUE) // blue
445 dlightcolor[0] += 20.0f;
446 dlightcolor[1] += 20.0f;
447 dlightcolor[2] += 200.0f;
449 if (effects & EF_FLAME)
451 if (ent->render.model)
455 mins[0] = neworg[0] - 16.0f;
456 mins[1] = neworg[1] - 16.0f;
457 mins[2] = neworg[2] - 16.0f;
458 maxs[0] = neworg[0] + 16.0f;
459 maxs[1] = neworg[1] + 16.0f;
460 maxs[2] = neworg[2] + 16.0f;
461 // how many flames to make
462 temp = (int) (cl.time * 300) - (int) (cl.oldtime * 300);
463 CL_FlameCube(mins, maxs, temp);
465 d = lhrandom(200, 250);
466 dlightcolor[0] += d * 1.0f;
467 dlightcolor[1] += d * 0.7f;
468 dlightcolor[2] += d * 0.3f;
470 if (effects & EF_STARDUST)
472 if (ent->render.model)
476 mins[0] = neworg[0] - 16.0f;
477 mins[1] = neworg[1] - 16.0f;
478 mins[2] = neworg[2] - 16.0f;
479 maxs[0] = neworg[0] + 16.0f;
480 maxs[1] = neworg[1] + 16.0f;
481 maxs[2] = neworg[2] + 16.0f;
482 // how many particles to make
483 temp = (int) (cl.time * 200) - (int) (cl.oldtime * 200);
484 CL_Stardust(mins, maxs, temp);
487 dlightcolor[0] += d * 1.0f;
488 dlightcolor[1] += d * 0.7f;
489 dlightcolor[2] += d * 0.3f;
493 if (ent->persistent.muzzleflash > 0)
497 AngleVectors (ent->render.angles, v, NULL, NULL);
499 v2[0] = v[0] * 18 + neworg[0];
500 v2[1] = v[1] * 18 + neworg[1];
501 v2[2] = v[2] * 18 + neworg[2] + 16;
502 CL_TraceLine(neworg, v2, v, NULL, 0, true);
504 CL_AllocDlight (NULL, v, ent->persistent.muzzleflash, 1, 1, 1, 0, 0);
505 ent->persistent.muzzleflash -= cl.frametime * 1000;
508 // LordHavoc: if the model has no flags, don't check each
509 if (ent->render.model && ent->render.model->flags)
511 if (ent->render.model->flags & EF_ROTATE)
513 ent->render.angles[1] = bobjrotate;
514 ent->render.origin[2] += bobjoffset;
516 // only do trails if present in the previous frame as well
517 if (ent->state_previous.active)
519 if (ent->render.model->flags & EF_GIB)
520 CL_RocketTrail (oldorg, neworg, 2, ent);
521 else if (ent->render.model->flags & EF_ZOMGIB)
522 CL_RocketTrail (oldorg, neworg, 4, ent);
523 else if (ent->render.model->flags & EF_TRACER)
524 CL_RocketTrail (oldorg, neworg, 3, ent);
525 else if (ent->render.model->flags & EF_TRACER2)
526 CL_RocketTrail (oldorg, neworg, 5, ent);
527 else if (ent->render.model->flags & EF_ROCKET)
529 CL_RocketTrail (oldorg, ent->render.origin, 0, ent);
530 dlightcolor[0] += 200.0f;
531 dlightcolor[1] += 160.0f;
532 dlightcolor[2] += 80.0f;
534 else if (ent->render.model->flags & EF_GRENADE)
536 if (ent->render.alpha == -1) // LordHavoc: Nehahra dem compatibility
537 CL_RocketTrail (oldorg, neworg, 7, ent);
539 CL_RocketTrail (oldorg, neworg, 1, ent);
541 else if (ent->render.model->flags & EF_TRACER3)
542 CL_RocketTrail (oldorg, neworg, 6, ent);
545 // LordHavoc: customizable glow
546 glowsize = ent->state_current.glowsize; // FIXME: interpolate?
547 glowcolor = ent->state_current.glowcolor;
550 qbyte *tempcolor = (qbyte *)&d_8to24table[glowcolor];
551 // * 4 for the expansion from 0-255 to 0-1023 range,
552 // / 255 to scale down byte colors
553 glowsize *= (4.0f / 255.0f);
554 VectorMA(dlightcolor, glowsize, tempcolor, dlightcolor);
556 // LordHavoc: customizable trail
557 if (ent->render.flags & RENDER_GLOWTRAIL)
558 CL_RocketTrail2 (oldorg, neworg, glowcolor, ent);
560 if (dlightcolor[0] || dlightcolor[1] || dlightcolor[2])
563 VectorCopy(neworg, vec);
564 // hack to make glowing player light shine on their gun
565 if (i == cl.viewentity && !chase_active.integer)
567 CL_AllocDlight (NULL, vec, 1, dlightcolor[0], dlightcolor[1], dlightcolor[2], 0, 0);
570 if (chase_active.integer)
572 if (ent->render.flags & RENDER_VIEWMODEL)
577 if (i == cl.viewentity || (ent->render.flags & RENDER_EXTERIORMODEL))
581 if (ent->render.model == NULL)
583 if (effects & EF_NODRAW)
585 if (r_refdef.numentities < MAX_VISEDICTS)
586 r_refdef.entities[r_refdef.numentities++] = &ent->render;
590 void CL_LerpPlayer(float frac)
595 if (cl.entitydatabase.numframes)
597 cl.viewentorigin[0] = cl.viewentoriginold[0] + frac * (cl.viewentoriginnew[0] - cl.viewentoriginold[0]);
598 cl.viewentorigin[1] = cl.viewentoriginold[1] + frac * (cl.viewentoriginnew[1] - cl.viewentoriginold[1]);
599 cl.viewentorigin[2] = cl.viewentoriginold[2] + frac * (cl.viewentoriginnew[2] - cl.viewentoriginold[2]);
602 VectorCopy (cl_entities[cl.viewentity].render.origin, cl.viewentorigin);
604 cl.viewzoom = cl.viewzoomold + frac * (cl.viewzoomnew - cl.viewzoomold);
606 for (i = 0;i < 3;i++)
607 cl.velocity[i] = cl.mvelocity[1][i] + frac * (cl.mvelocity[0][i] - cl.mvelocity[1][i]);
609 if (cls.demoplayback)
611 // interpolate the angles
612 for (i = 0;i < 3;i++)
614 d = cl.mviewangles[0][i] - cl.mviewangles[1][i];
619 cl.viewangles[i] = cl.mviewangles[1][i] + frac*d;
624 void CL_Effect(vec3_t org, int modelindex, int startframe, int framecount, float framerate)
628 if (!modelindex) // sanity check
630 for (i = 0, e = cl_effect;i < MAX_EFFECTS;i++, e++)
635 VectorCopy(org, e->origin);
636 e->modelindex = modelindex;
637 e->starttime = cl.time;
638 e->startframe = startframe;
639 e->endframe = startframe + framecount;
640 e->framerate = framerate;
643 e->frame1time = cl.time;
644 e->frame2time = cl.time;
649 static void CL_RelinkEffects()
656 for (i = 0, e = cl_effect;i < MAX_EFFECTS;i++, e++)
660 frame = (cl.time - e->starttime) * e->framerate + e->startframe;
662 if (intframe < 0 || intframe >= e->endframe)
665 memset(e, 0, sizeof(*e));
669 if (intframe != e->frame)
672 e->frame1time = e->frame2time;
673 e->frame2time = cl.time;
676 if ((vis = CL_NewTempEntity()))
678 // interpolation stuff
679 vis->render.frame1 = intframe;
680 vis->render.frame2 = intframe + 1;
681 if (vis->render.frame2 >= e->endframe)
682 vis->render.frame2 = -1; // disappear
683 vis->render.framelerp = frame - intframe;
684 vis->render.frame1time = e->frame1time;
685 vis->render.frame2time = e->frame2time;
688 VectorCopy(e->origin, vis->render.origin);
689 vis->render.model = cl.model_precache[e->modelindex];
690 vis->render.frame = vis->render.frame2;
691 vis->render.colormap = -1; // no special coloring
692 vis->render.scale = 1;
693 vis->render.alpha = 1;
699 void CL_RelinkEntities (void)
703 // fraction from previous network update to current
704 frac = CL_LerpPoint ();
707 CL_RelinkStaticEntities();
708 CL_RelinkNetworkEntities();
709 CL_TraceLine_ScanForBModels();
722 Read all incoming data from the server
725 int CL_ReadFromServer (void)
729 cl.oldtime = cl.time;
730 cl.time += cl.frametime;
735 ret = CL_GetMessage ();
737 Host_Error ("CL_ReadFromServer: lost server connection");
741 cl.last_received_message = realtime;
743 if (cl_shownet.integer)
746 CL_ParseServerMessage ();
748 while (ret && cls.state == ca_connected);
753 r_refdef.numentities = 0;
754 if (cls.state == ca_connected && cl.worldmodel)
756 CL_RelinkEntities ();
758 // run cgame code (which can add more entities)
763 // bring the links up to date
773 void CL_SendCmd (void)
777 if (cls.state != ca_connected)
780 if (cls.signon == SIGNONS)
782 // get basic movement from keyboard
785 IN_PreMove(); // OS independent code
787 // allow mice or other external controllers to add to the move
790 IN_PostMove(); // OS independent code
792 // send the unreliable message
798 // LordHavoc: fix for NAT routing of netquake:
799 // bounce back a clc_nop message to the newly allocated server port,
800 // to establish a routing connection for incoming frames,
801 // the server waits for this before sending anything
802 if (realtime > cl.sendnoptime)
804 Con_DPrintf("sending clc_nop to get server's attention\n");
805 cl.sendnoptime = realtime + 3;
806 MSG_WriteByte(&cls.message, clc_nop);
811 if (cls.demoplayback)
813 SZ_Clear (&cls.message);
817 // send the reliable message
818 if (!cls.message.cursize)
819 return; // no message at all
821 if (!NET_CanSendMessage (cls.netcon))
823 Con_DPrintf ("CL_WriteToServer: can't send\n");
827 if (NET_SendMessage (cls.netcon, &cls.message) == -1)
828 Host_Error ("CL_WriteToServer: lost server connection");
830 SZ_Clear (&cls.message);
833 // LordHavoc: pausedemo command
834 static void CL_PauseDemo_f (void)
836 cls.demopaused = !cls.demopaused;
838 Con_Printf("Demo paused\n");
840 Con_Printf("Demo unpaused\n");
844 ======================
846 LordHavoc: Intended for Nehahra, I personally think this is dumb, but Mindcrime won't listen.
847 ======================
849 static void CL_PModel_f (void)
854 if (Cmd_Argc () == 1)
856 Con_Printf ("\"pmodel\" is \"%s\"\n", cl_pmodel.string);
859 i = atoi(Cmd_Argv(1));
861 if (cmd_source == src_command)
863 if (cl_pmodel.integer == i)
865 Cvar_SetValue ("_cl_pmodel", i);
866 if (cls.state == ca_connected)
867 Cmd_ForwardToServer ();
871 host_client->pmodel = i;
872 if ((val = GETEDICTFIELDVALUE(host_client->edict, eval_pmodel)))
877 ======================
879 ======================
881 static void CL_Fog_f (void)
883 if (Cmd_Argc () == 1)
885 Con_Printf ("\"fog\" is \"%f %f %f %f\"\n", fog_density, fog_red, fog_green, fog_blue);
888 fog_density = atof(Cmd_Argv(1));
889 fog_red = atof(Cmd_Argv(2));
890 fog_green = atof(Cmd_Argv(3));
891 fog_blue = atof(Cmd_Argv(4));
901 cl_scores_mempool = Mem_AllocPool("client player info");
903 cl_refdef_mempool = Mem_AllocPool("refdef");
904 memset(&r_refdef, 0, sizeof(r_refdef));
905 r_refdef.entities = Mem_Alloc(cl_refdef_mempool, sizeof(entity_render_t *) * MAX_VISEDICTS);
907 SZ_Alloc (&cls.message, 1024, "cls.message");
913 // register our commands
915 Cvar_RegisterVariable (&cl_name);
916 Cvar_RegisterVariable (&cl_color);
917 if (gamemode == GAME_NEHAHRA)
918 Cvar_RegisterVariable (&cl_pmodel);
919 Cvar_RegisterVariable (&cl_upspeed);
920 Cvar_RegisterVariable (&cl_forwardspeed);
921 Cvar_RegisterVariable (&cl_backspeed);
922 Cvar_RegisterVariable (&cl_sidespeed);
923 Cvar_RegisterVariable (&cl_movespeedkey);
924 Cvar_RegisterVariable (&cl_yawspeed);
925 Cvar_RegisterVariable (&cl_pitchspeed);
926 Cvar_RegisterVariable (&cl_anglespeedkey);
927 Cvar_RegisterVariable (&cl_shownet);
928 Cvar_RegisterVariable (&cl_nolerp);
929 Cvar_RegisterVariable (&lookspring);
930 Cvar_RegisterVariable (&lookstrafe);
931 Cvar_RegisterVariable (&sensitivity);
932 Cvar_RegisterVariable (&freelook);
934 Cvar_RegisterVariable (&m_pitch);
935 Cvar_RegisterVariable (&m_yaw);
936 Cvar_RegisterVariable (&m_forward);
937 Cvar_RegisterVariable (&m_side);
939 Cvar_RegisterVariable (&cl_itembobspeed);
940 Cvar_RegisterVariable (&cl_itembobheight);
942 Cmd_AddCommand ("entities", CL_PrintEntities_f);
943 Cmd_AddCommand ("bitprofile", CL_BitProfile_f);
944 Cmd_AddCommand ("disconnect", CL_Disconnect_f);
945 Cmd_AddCommand ("record", CL_Record_f);
946 Cmd_AddCommand ("stop", CL_Stop_f);
947 Cmd_AddCommand ("playdemo", CL_PlayDemo_f);
948 Cmd_AddCommand ("timedemo", CL_TimeDemo_f);
950 Cmd_AddCommand ("fog", CL_Fog_f);
952 // LordHavoc: added pausedemo
953 Cmd_AddCommand ("pausedemo", CL_PauseDemo_f);
954 if (gamemode == GAME_NEHAHRA)
955 Cmd_AddCommand ("pmodel", CL_PModel_f);
957 Cvar_RegisterVariable(&cl_draweffects);