2000-05-10 20:33:16 +00:00
|
|
|
/*
|
2000-05-11 16:03:29 +00:00
|
|
|
cl_ents.c
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-05-22 06:46:35 +00:00
|
|
|
entity parsing and management
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-05-11 16:03:29 +00:00
|
|
|
Copyright (C) 1996-1997 Id Software, Inc.
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-05-11 16:03:29 +00:00
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-05-11 16:03:29 +00:00
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-05-11 16:03:29 +00:00
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to:
|
|
|
|
|
|
|
|
Free Software Foundation, Inc.
|
|
|
|
59 Temple Place - Suite 330
|
|
|
|
Boston, MA 02111-1307, USA
|
|
|
|
|
|
|
|
$Id$
|
2000-05-10 20:33:16 +00:00
|
|
|
*/
|
|
|
|
|
2000-05-17 10:03:19 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
2000-12-08 06:51:37 +00:00
|
|
|
# include "config.h"
|
2000-05-17 10:03:19 +00:00
|
|
|
#endif
|
2000-12-05 06:33:44 +00:00
|
|
|
|
|
|
|
#include "host.h"
|
2000-05-14 16:56:28 +00:00
|
|
|
#include "sys.h"
|
2000-05-21 08:24:45 +00:00
|
|
|
#include "sys.h"
|
|
|
|
#include "cvar.h"
|
|
|
|
#include "sizebuf.h"
|
|
|
|
#include "msg.h"
|
|
|
|
#include "client.h"
|
|
|
|
#include "commdef.h"
|
|
|
|
#include "cmd.h"
|
|
|
|
#include "console.h"
|
|
|
|
#include "qendian.h"
|
|
|
|
#include "quakefs.h"
|
|
|
|
#include "pmove.h"
|
|
|
|
#include "view.h"
|
2000-08-02 23:00:39 +00:00
|
|
|
#include "teamplay.h"
|
2000-10-28 08:02:08 +00:00
|
|
|
#include "r_dynamic.h"
|
2000-10-29 15:35:24 +00:00
|
|
|
#include "cl_cam.h"
|
|
|
|
#include "cl_pred.h"
|
|
|
|
#include "cl_main.h"
|
|
|
|
#include "cl_ents.h"
|
|
|
|
#include "cl_input.h"
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
extern cvar_t *cl_predict_players;
|
|
|
|
extern cvar_t *cl_predict_players2;
|
|
|
|
extern cvar_t *cl_solid_players;
|
2000-05-16 04:47:41 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
extern cvar_t *gl_flashblend;
|
2000-05-13 00:27:23 +00:00
|
|
|
|
2000-05-10 20:33:16 +00:00
|
|
|
static struct predicted_player {
|
2000-12-08 06:51:37 +00:00
|
|
|
int flags;
|
|
|
|
qboolean active;
|
|
|
|
vec3_t origin; // predicted origin
|
2000-05-10 20:33:16 +00:00
|
|
|
} predicted_players[MAX_CLIENTS];
|
|
|
|
|
|
|
|
//============================================================
|
|
|
|
|
|
|
|
/*
|
|
|
|
===============
|
|
|
|
CL_AllocDlight
|
|
|
|
|
|
|
|
===============
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
dlight_t *
|
|
|
|
CL_AllocDlight (int key)
|
2000-05-10 20:33:16 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
int i;
|
|
|
|
dlight_t *dl;
|
2000-05-10 20:33:16 +00:00
|
|
|
|
|
|
|
// first look for an exact key match
|
2000-12-08 06:51:37 +00:00
|
|
|
if (key) {
|
2000-05-10 20:33:16 +00:00
|
|
|
dl = cl_dlights;
|
2000-12-08 06:51:37 +00:00
|
|
|
for (i = 0; i < MAX_DLIGHTS; i++, dl++) {
|
|
|
|
if (dl->key == key) {
|
|
|
|
memset (dl, 0, sizeof (*dl));
|
2000-05-10 20:33:16 +00:00
|
|
|
dl->key = key;
|
2000-06-19 22:15:18 +00:00
|
|
|
dl->color = dl->_color;
|
2000-05-10 20:33:16 +00:00
|
|
|
return dl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// then look for anything else
|
|
|
|
dl = cl_dlights;
|
2000-12-08 06:51:37 +00:00
|
|
|
for (i = 0; i < MAX_DLIGHTS; i++, dl++) {
|
|
|
|
if (dl->die < cl.time) {
|
|
|
|
memset (dl, 0, sizeof (*dl));
|
2000-05-10 20:33:16 +00:00
|
|
|
dl->key = key;
|
2000-06-19 22:15:18 +00:00
|
|
|
dl->color = dl->_color;
|
2000-05-10 20:33:16 +00:00
|
|
|
return dl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dl = &cl_dlights[0];
|
2000-12-08 06:51:37 +00:00
|
|
|
memset (dl, 0, sizeof (*dl));
|
2000-05-10 20:33:16 +00:00
|
|
|
dl->key = key;
|
2000-06-19 22:15:18 +00:00
|
|
|
dl->color = dl->_color;
|
2000-05-10 20:33:16 +00:00
|
|
|
return dl;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
===============
|
|
|
|
CL_NewDlight
|
|
|
|
===============
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
CL_NewDlight (int key, float x, float y, float z, float radius, float time,
|
|
|
|
int type)
|
2000-05-10 20:33:16 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
dlight_t *dl;
|
2000-05-10 20:33:16 +00:00
|
|
|
|
|
|
|
dl = CL_AllocDlight (key);
|
|
|
|
dl->origin[0] = x;
|
|
|
|
dl->origin[1] = y;
|
|
|
|
dl->origin[2] = z;
|
|
|
|
dl->radius = radius;
|
|
|
|
dl->die = cl.time + time;
|
2000-12-08 06:51:37 +00:00
|
|
|
switch (type) {
|
2000-05-24 23:55:43 +00:00
|
|
|
default:
|
|
|
|
case 0:
|
2000-05-25 04:16:41 +00:00
|
|
|
dl->color[0] = 0.4;
|
|
|
|
dl->color[1] = 0.2;
|
2000-05-24 23:55:43 +00:00
|
|
|
dl->color[2] = 0.05;
|
|
|
|
break;
|
2000-12-08 06:51:37 +00:00
|
|
|
case 1: // blue
|
2000-05-24 23:55:43 +00:00
|
|
|
dl->color[0] = 0.05;
|
|
|
|
dl->color[1] = 0.05;
|
2000-05-25 04:16:41 +00:00
|
|
|
dl->color[2] = 0.5;
|
2000-05-24 23:55:43 +00:00
|
|
|
break;
|
2000-12-08 06:51:37 +00:00
|
|
|
case 2: // red
|
2000-05-24 23:55:43 +00:00
|
|
|
dl->color[0] = 0.5;
|
|
|
|
dl->color[1] = 0.05;
|
|
|
|
dl->color[2] = 0.05;
|
|
|
|
break;
|
2000-12-08 06:51:37 +00:00
|
|
|
case 3: // purple
|
2000-05-24 23:55:43 +00:00
|
|
|
dl->color[0] = 0.5;
|
|
|
|
dl->color[1] = 0.05;
|
2000-05-25 04:16:41 +00:00
|
|
|
dl->color[2] = 0.5;
|
2000-05-24 23:55:43 +00:00
|
|
|
break;
|
2000-05-10 20:33:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
===============
|
|
|
|
CL_DecayLights
|
|
|
|
|
|
|
|
===============
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
CL_DecayLights (void)
|
2000-05-10 20:33:16 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
int i;
|
|
|
|
dlight_t *dl;
|
2000-05-10 20:33:16 +00:00
|
|
|
|
|
|
|
dl = cl_dlights;
|
2000-12-08 06:51:37 +00:00
|
|
|
for (i = 0; i < MAX_DLIGHTS; i++, dl++) {
|
2000-05-10 20:33:16 +00:00
|
|
|
if (dl->die < cl.time || !dl->radius)
|
|
|
|
continue;
|
2000-12-08 06:51:37 +00:00
|
|
|
|
|
|
|
dl->radius -= host_frametime * dl->decay;
|
2000-05-10 20:33:16 +00:00
|
|
|
if (dl->radius < 0)
|
|
|
|
dl->radius = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
=========================================================================
|
|
|
|
|
|
|
|
PACKET ENTITY PARSING / LINKING
|
|
|
|
|
|
|
|
=========================================================================
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
==================
|
|
|
|
CL_ParseDelta
|
|
|
|
|
|
|
|
Can go from either a baseline or a previous packet_entity
|
|
|
|
==================
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
int bitcounts[32]; // / just for protocol profiling
|
|
|
|
void
|
|
|
|
CL_ParseDelta (entity_state_t *from, entity_state_t *to, int bits)
|
2000-05-10 20:33:16 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
int i;
|
2000-05-10 20:33:16 +00:00
|
|
|
|
|
|
|
// set everything to the state we are delta'ing from
|
|
|
|
*to = *from;
|
|
|
|
|
|
|
|
to->number = bits & 511;
|
|
|
|
bits &= ~511;
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
if (bits & U_MOREBITS) { // read in the low order bits
|
2000-05-10 20:33:16 +00:00
|
|
|
i = MSG_ReadByte ();
|
|
|
|
bits |= i;
|
|
|
|
}
|
|
|
|
// count the bits for net profiling
|
2000-06-25 20:53:26 +00:00
|
|
|
// for (i=0 ; i<16 ; i++)
|
|
|
|
// if (bits&(1<<i))
|
|
|
|
// bitcounts[i]++;
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
// LordHavoc: Endy neglected to mark this as being part of the QSG
|
|
|
|
// version 2 stuff...
|
|
|
|
if (bits & U_EXTEND1) {
|
|
|
|
bits |= MSG_ReadByte () << 16;
|
2000-07-01 04:56:13 +00:00
|
|
|
if (bits & U_EXTEND2)
|
2000-12-08 06:51:37 +00:00
|
|
|
bits |= MSG_ReadByte () << 24;
|
2000-07-01 04:56:13 +00:00
|
|
|
}
|
2000-06-25 13:00:19 +00:00
|
|
|
|
2000-05-10 20:33:16 +00:00
|
|
|
to->flags = bits;
|
2000-12-08 06:51:37 +00:00
|
|
|
|
2000-05-10 20:33:16 +00:00
|
|
|
if (bits & U_MODEL)
|
|
|
|
to->modelindex = MSG_ReadByte ();
|
2000-12-08 06:51:37 +00:00
|
|
|
|
2000-05-10 20:33:16 +00:00
|
|
|
if (bits & U_FRAME)
|
|
|
|
to->frame = MSG_ReadByte ();
|
|
|
|
|
|
|
|
if (bits & U_COLORMAP)
|
2000-12-08 06:51:37 +00:00
|
|
|
to->colormap = MSG_ReadByte ();
|
2000-05-10 20:33:16 +00:00
|
|
|
|
|
|
|
if (bits & U_SKIN)
|
2000-12-08 06:51:37 +00:00
|
|
|
to->skinnum = MSG_ReadByte ();
|
2000-05-10 20:33:16 +00:00
|
|
|
|
|
|
|
if (bits & U_EFFECTS)
|
2000-12-08 06:51:37 +00:00
|
|
|
to->effects = MSG_ReadByte ();
|
2000-05-10 20:33:16 +00:00
|
|
|
|
|
|
|
if (bits & U_ORIGIN1)
|
|
|
|
to->origin[0] = MSG_ReadCoord ();
|
2000-12-08 06:51:37 +00:00
|
|
|
|
2000-05-10 20:33:16 +00:00
|
|
|
if (bits & U_ANGLE1)
|
2000-12-08 06:51:37 +00:00
|
|
|
to->angles[0] = MSG_ReadAngle ();
|
2000-05-10 20:33:16 +00:00
|
|
|
|
|
|
|
if (bits & U_ORIGIN2)
|
|
|
|
to->origin[1] = MSG_ReadCoord ();
|
2000-12-08 06:51:37 +00:00
|
|
|
|
2000-05-10 20:33:16 +00:00
|
|
|
if (bits & U_ANGLE2)
|
2000-12-08 06:51:37 +00:00
|
|
|
to->angles[1] = MSG_ReadAngle ();
|
2000-05-10 20:33:16 +00:00
|
|
|
|
|
|
|
if (bits & U_ORIGIN3)
|
|
|
|
to->origin[2] = MSG_ReadCoord ();
|
2000-12-08 06:51:37 +00:00
|
|
|
|
2000-05-10 20:33:16 +00:00
|
|
|
if (bits & U_ANGLE3)
|
2000-12-08 06:51:37 +00:00
|
|
|
to->angles[2] = MSG_ReadAngle ();
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
// LordHavoc: Endy neglected to mark this as being part of the QSG
|
|
|
|
// version 2 stuff...
|
|
|
|
// rearranged it and implemented missing effects
|
2000-07-01 04:56:13 +00:00
|
|
|
// Ender (QSG - Begin)
|
|
|
|
if (bits & U_ALPHA)
|
2000-12-08 06:51:37 +00:00
|
|
|
to->alpha = MSG_ReadByte ();
|
2000-07-01 04:56:13 +00:00
|
|
|
if (bits & U_SCALE)
|
2000-12-08 06:51:37 +00:00
|
|
|
to->scale = MSG_ReadByte ();
|
2000-07-01 04:56:13 +00:00
|
|
|
if (bits & U_EFFECTS2)
|
2000-12-08 06:51:37 +00:00
|
|
|
to->effects = (to->effects & 0xFF) | (MSG_ReadByte () << 8);
|
2000-07-01 04:56:13 +00:00
|
|
|
if (bits & U_GLOWSIZE)
|
2000-12-08 06:51:37 +00:00
|
|
|
to->glowsize = MSG_ReadByte ();
|
2000-07-01 04:56:13 +00:00
|
|
|
if (bits & U_GLOWCOLOR)
|
2000-12-08 06:51:37 +00:00
|
|
|
to->glowcolor = MSG_ReadByte ();
|
2000-07-01 04:56:13 +00:00
|
|
|
if (bits & U_COLORMOD)
|
2000-12-08 06:51:37 +00:00
|
|
|
to->colormod = MSG_ReadByte ();
|
2000-07-01 04:56:13 +00:00
|
|
|
if (bits & U_FRAME2)
|
2000-12-08 06:51:37 +00:00
|
|
|
to->frame = (to->frame & 0xFF) | (MSG_ReadByte () << 8);
|
2000-07-01 04:56:13 +00:00
|
|
|
// Ender (QSG - End)
|
2000-06-25 13:00:19 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
if (bits & U_SOLID) {
|
2000-05-10 20:33:16 +00:00
|
|
|
// FIXME
|
|
|
|
}
|
2000-12-08 06:51:37 +00:00
|
|
|
/*
|
|
|
|
if ((!to->alpha) || (!to->colormod)) Con_Printf("fa: %d, fc: %d, ta:
|
|
|
|
%d, tc: %d\n", from->alpha, from->colormod, to->alpha, to->colormod); */
|
|
|
|
/*
|
|
|
|
if ((!ent->alpha) || (!ent->colormod[0]) || (!ent->colormod[1]) ||
|
|
|
|
(!ent->colormod[2])) { Con_Printf("ea: %f, ec0: %f, ec1: %f ec2: %f,
|
|
|
|
sa: %d, sc: %d\n", ent->alpha, ent->colormod[0], ent->colormod[1],
|
|
|
|
ent->colormod[2], s1->alpha, s1->colormod); } */
|
2000-05-10 20:33:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
=================
|
|
|
|
FlushEntityPacket
|
|
|
|
=================
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
FlushEntityPacket (void)
|
2000-05-10 20:33:16 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
int word;
|
|
|
|
entity_state_t olde, newe;
|
2000-05-10 20:33:16 +00:00
|
|
|
|
|
|
|
Con_DPrintf ("FlushEntityPacket\n");
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
memset (&olde, 0, sizeof (olde));
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
cl.validsequence = 0; // can't render a frame
|
|
|
|
cl.frames[cls.netchan.incoming_sequence & UPDATE_MASK].invalid = true;
|
2000-05-10 20:33:16 +00:00
|
|
|
|
|
|
|
// read it all, but ignore it
|
2000-12-08 06:51:37 +00:00
|
|
|
while (1) {
|
|
|
|
word = (unsigned short) MSG_ReadShort ();
|
|
|
|
if (msg_badread) { // something didn't parse right...
|
2000-05-10 20:33:16 +00:00
|
|
|
Host_EndGame ("msg_badread in packetentities");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!word)
|
2000-12-08 06:51:37 +00:00
|
|
|
break; // done
|
2000-05-10 20:33:16 +00:00
|
|
|
|
|
|
|
CL_ParseDelta (&olde, &newe, word);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
==================
|
|
|
|
CL_ParsePacketEntities
|
|
|
|
|
|
|
|
An svc_packetentities has just been parsed, deal with the
|
|
|
|
rest of the data stream.
|
|
|
|
==================
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
CL_ParsePacketEntities (qboolean delta)
|
2000-05-10 20:33:16 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
int oldpacket, newpacket;
|
|
|
|
packet_entities_t *oldp, *newp, dummy;
|
|
|
|
int oldindex, newindex;
|
|
|
|
int word, newnum, oldnum;
|
|
|
|
qboolean full;
|
|
|
|
byte from;
|
|
|
|
|
|
|
|
newpacket = cls.netchan.incoming_sequence & UPDATE_MASK;
|
2000-05-10 20:33:16 +00:00
|
|
|
newp = &cl.frames[newpacket].packet_entities;
|
|
|
|
cl.frames[newpacket].invalid = false;
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
if (delta) {
|
2000-05-10 20:33:16 +00:00
|
|
|
from = MSG_ReadByte ();
|
|
|
|
|
|
|
|
oldpacket = cl.frames[newpacket].delta_sequence;
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
if ((from & UPDATE_MASK) != (oldpacket & UPDATE_MASK))
|
2000-05-10 20:33:16 +00:00
|
|
|
Con_DPrintf ("WARNING: from mismatch\n");
|
2000-12-08 06:51:37 +00:00
|
|
|
} else
|
2000-05-10 20:33:16 +00:00
|
|
|
oldpacket = -1;
|
|
|
|
|
|
|
|
full = false;
|
2000-12-08 06:51:37 +00:00
|
|
|
if (oldpacket != -1) {
|
2000-12-11 09:59:27 +00:00
|
|
|
if (cls.netchan.outgoing_sequence - oldpacket >= UPDATE_BACKUP - 1) {
|
|
|
|
// we can't use this, it is too old
|
2000-05-10 20:33:16 +00:00
|
|
|
FlushEntityPacket ();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
cl.validsequence = cls.netchan.incoming_sequence;
|
2000-12-08 06:51:37 +00:00
|
|
|
oldp = &cl.frames[oldpacket & UPDATE_MASK].packet_entities;
|
2000-12-11 09:59:27 +00:00
|
|
|
} else { // a full update that we can start delta compressing from now
|
2000-05-10 20:33:16 +00:00
|
|
|
oldp = &dummy;
|
|
|
|
dummy.num_entities = 0;
|
|
|
|
cl.validsequence = cls.netchan.incoming_sequence;
|
|
|
|
full = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
oldindex = 0;
|
|
|
|
newindex = 0;
|
|
|
|
newp->num_entities = 0;
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
while (1) {
|
|
|
|
word = (unsigned short) MSG_ReadShort ();
|
|
|
|
if (msg_badread) { // something didn't parse right...
|
2000-05-10 20:33:16 +00:00
|
|
|
Host_EndGame ("msg_badread in packetentities");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
if (!word) {
|
|
|
|
while (oldindex < oldp->num_entities) { // copy all the rest of
|
|
|
|
// the entities from the
|
|
|
|
// old packet
|
2000-05-10 20:33:16 +00:00
|
|
|
//Con_Printf ("copy %i\n", oldp->entities[oldindex].number);
|
|
|
|
if (newindex >= MAX_PACKET_ENTITIES)
|
2000-12-08 06:51:37 +00:00
|
|
|
Host_EndGame
|
|
|
|
("CL_ParsePacketEntities: newindex == MAX_PACKET_ENTITIES");
|
2000-05-10 20:33:16 +00:00
|
|
|
newp->entities[newindex] = oldp->entities[oldindex];
|
|
|
|
newindex++;
|
|
|
|
oldindex++;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2000-12-08 06:51:37 +00:00
|
|
|
newnum = word & 511;
|
|
|
|
oldnum =
|
|
|
|
oldindex >=
|
|
|
|
oldp->num_entities ? 9999 : oldp->entities[oldindex].number;
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
while (newnum > oldnum) {
|
|
|
|
if (full) {
|
2000-05-10 20:33:16 +00:00
|
|
|
Con_Printf ("WARNING: oldcopy on full update");
|
|
|
|
FlushEntityPacket ();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
//Con_Printf ("copy %i\n", oldnum);
|
|
|
|
// copy one of the old entities over to the new packet unchanged
|
|
|
|
if (newindex >= MAX_PACKET_ENTITIES)
|
2000-12-08 06:51:37 +00:00
|
|
|
Host_EndGame
|
|
|
|
("CL_ParsePacketEntities: newindex == MAX_PACKET_ENTITIES");
|
2000-05-10 20:33:16 +00:00
|
|
|
newp->entities[newindex] = oldp->entities[oldindex];
|
|
|
|
newindex++;
|
|
|
|
oldindex++;
|
2000-12-08 06:51:37 +00:00
|
|
|
oldnum =
|
|
|
|
oldindex >=
|
|
|
|
oldp->num_entities ? 9999 : oldp->entities[oldindex].number;
|
2000-05-10 20:33:16 +00:00
|
|
|
}
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
if (newnum < oldnum) { // new from baseline
|
2000-05-10 20:33:16 +00:00
|
|
|
//Con_Printf ("baseline %i\n", newnum);
|
2000-12-08 06:51:37 +00:00
|
|
|
if (word & U_REMOVE) {
|
|
|
|
if (full) {
|
2000-05-10 20:33:16 +00:00
|
|
|
cl.validsequence = 0;
|
|
|
|
Con_Printf ("WARNING: U_REMOVE on full update\n");
|
|
|
|
FlushEntityPacket ();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (newindex >= MAX_PACKET_ENTITIES)
|
2000-12-08 06:51:37 +00:00
|
|
|
Host_EndGame
|
|
|
|
("CL_ParsePacketEntities: newindex == MAX_PACKET_ENTITIES");
|
|
|
|
CL_ParseDelta (&cl_baselines[newnum], &newp->entities[newindex],
|
|
|
|
word);
|
2000-05-10 20:33:16 +00:00
|
|
|
newindex++;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
if (newnum == oldnum) { // delta from previous
|
|
|
|
if (full) {
|
2000-05-10 20:33:16 +00:00
|
|
|
cl.validsequence = 0;
|
|
|
|
Con_Printf ("WARNING: delta on full update");
|
|
|
|
}
|
2000-12-08 06:51:37 +00:00
|
|
|
if (word & U_REMOVE) {
|
2000-05-10 20:33:16 +00:00
|
|
|
oldindex++;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
//Con_Printf ("delta %i\n",newnum);
|
2000-12-08 06:51:37 +00:00
|
|
|
CL_ParseDelta (&oldp->entities[oldindex], &newp->entities[newindex],
|
|
|
|
word);
|
2000-05-10 20:33:16 +00:00
|
|
|
newindex++;
|
|
|
|
oldindex++;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
newp->num_entities = newindex;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
===============
|
|
|
|
CL_LinkPacketEntities
|
|
|
|
|
|
|
|
===============
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
CL_LinkPacketEntities (void)
|
2000-05-10 20:33:16 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
entity_t *ent;
|
|
|
|
packet_entities_t *pack;
|
|
|
|
entity_state_t *s1, *s2;
|
|
|
|
float f;
|
|
|
|
model_t *model;
|
|
|
|
vec3_t old_origin;
|
|
|
|
float autorotate;
|
|
|
|
int i;
|
|
|
|
int pnum;
|
|
|
|
dlight_t *dl;
|
|
|
|
extern int cl_playerindex;
|
|
|
|
extern int cl_h_playerindex, cl_gib1index, cl_gib2index, cl_gib3index;
|
|
|
|
|
2000-12-11 09:59:27 +00:00
|
|
|
pack = &cl.frames[cls.netchan.incoming_sequence & UPDATE_MASK].packet_entities;
|
2000-12-08 06:51:37 +00:00
|
|
|
|
|
|
|
autorotate = anglemod (100 * cl.time);
|
|
|
|
|
|
|
|
f = 0; // FIXME: no interpolation right now
|
|
|
|
|
|
|
|
for (pnum = 0; pnum < pack->num_entities; pnum++) {
|
2000-05-10 20:33:16 +00:00
|
|
|
s1 = &pack->entities[pnum];
|
2000-12-11 09:59:27 +00:00
|
|
|
s2 = s1; // FIXME: no interpolation right now
|
2000-05-10 20:33:16 +00:00
|
|
|
|
|
|
|
// spawn light flashes, even ones coming from invisible objects
|
|
|
|
if ((s1->effects & (EF_BLUE | EF_RED)) == (EF_BLUE | EF_RED))
|
2000-12-11 09:59:27 +00:00
|
|
|
CL_NewDlight (s1->number, s1->origin[0], s1->origin[1], s1->origin[2], 200 + (rand () & 31), 0.1, 3);
|
2000-05-10 20:33:16 +00:00
|
|
|
else if (s1->effects & EF_BLUE)
|
2000-12-11 09:59:27 +00:00
|
|
|
CL_NewDlight (s1->number, s1->origin[0], s1->origin[1], s1->origin[2], 200 + (rand () & 31), 0.1, 1);
|
2000-05-10 20:33:16 +00:00
|
|
|
else if (s1->effects & EF_RED)
|
2000-12-11 09:59:27 +00:00
|
|
|
CL_NewDlight (s1->number, s1->origin[0], s1->origin[1], s1->origin[2], 200 + (rand () & 31), 0.1, 2);
|
2000-05-10 20:33:16 +00:00
|
|
|
else if (s1->effects & EF_BRIGHTLIGHT)
|
2000-12-11 09:59:27 +00:00
|
|
|
CL_NewDlight (s1->number, s1->origin[0], s1->origin[1], s1->origin[2] + 16, 400 + (rand () & 31), 0.1, 0);
|
2000-05-10 20:33:16 +00:00
|
|
|
else if (s1->effects & EF_DIMLIGHT)
|
2000-12-11 09:59:27 +00:00
|
|
|
CL_NewDlight (s1->number, s1->origin[0], s1->origin[1], s1->origin[2], 200 + (rand () & 31), 0.1, 0);
|
2000-05-10 20:33:16 +00:00
|
|
|
|
|
|
|
// if set to invisible, skip
|
|
|
|
if (!s1->modelindex)
|
|
|
|
continue;
|
|
|
|
|
2000-08-02 23:00:39 +00:00
|
|
|
// Hack hack hack
|
2000-10-17 03:17:42 +00:00
|
|
|
if (cl_deadbodyfilter->int_val && s1->modelindex == cl_playerindex
|
2000-12-08 06:51:37 +00:00
|
|
|
&& ((i = s1->frame) == 49 || i == 60 || i == 69 || i == 84
|
|
|
|
|| i == 93 || i == 102))
|
2000-08-02 23:00:39 +00:00
|
|
|
continue;
|
2000-10-17 03:17:42 +00:00
|
|
|
if (cl_gibfilter->int_val &&
|
2000-12-08 06:51:37 +00:00
|
|
|
(s1->modelindex == cl_h_playerindex
|
|
|
|
|| s1->modelindex == cl_gib1index || s1->modelindex == cl_gib2index
|
|
|
|
|| s1->modelindex == cl_gib3index))
|
2000-08-02 23:00:39 +00:00
|
|
|
continue;
|
|
|
|
|
2000-05-10 20:33:16 +00:00
|
|
|
// create a new entity
|
|
|
|
if (cl_numvisedicts == MAX_VISEDICTS)
|
2000-12-08 06:51:37 +00:00
|
|
|
break; // object list is full
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-12-11 09:59:27 +00:00
|
|
|
ent = &cl_visedicts[cl_numvisedicts++];
|
2000-05-10 20:33:16 +00:00
|
|
|
|
|
|
|
ent->keynum = s1->number;
|
|
|
|
ent->model = model = cl.model_precache[s1->modelindex];
|
2000-12-08 06:51:37 +00:00
|
|
|
|
2000-05-10 20:33:16 +00:00
|
|
|
// set colormap
|
2000-12-08 06:51:37 +00:00
|
|
|
if (s1->colormap && (s1->colormap < MAX_CLIENTS)
|
|
|
|
&& !strcmp (ent->model->name, "progs/player.mdl")) {
|
|
|
|
ent->colormap = cl.players[s1->colormap - 1].translations;
|
|
|
|
ent->scoreboard = &cl.players[s1->colormap - 1];
|
|
|
|
} else {
|
2000-05-10 20:33:16 +00:00
|
|
|
ent->colormap = vid.colormap;
|
|
|
|
ent->scoreboard = NULL;
|
|
|
|
}
|
|
|
|
|
2000-07-01 04:56:13 +00:00
|
|
|
// LordHavoc: cleaned up Endy's coding style, and fixed Endy's bugs
|
|
|
|
// Ender: Extend (Colormod) [QSG - Begin]
|
2000-12-08 06:51:37 +00:00
|
|
|
// N.B: All messy code below is the sole fault of LordHavoc and
|
|
|
|
// his futile attempts to save bandwidth. :)
|
2000-12-11 09:59:27 +00:00
|
|
|
ent->glowsize = s1->glowsize < 128 ? s1->glowsize * 8.0 : (s1->glowsize - 256) * 8.0;
|
2000-12-08 06:51:37 +00:00
|
|
|
ent->glowcolor = s1->glowcolor;
|
|
|
|
ent->alpha = s1->alpha / 255.0;
|
|
|
|
ent->scale = s1->scale / 16.0;
|
2000-07-01 04:56:13 +00:00
|
|
|
|
2000-12-11 09:59:27 +00:00
|
|
|
if (s1->colormod == 255) {
|
2000-07-01 04:56:13 +00:00
|
|
|
ent->colormod[0] = ent->colormod[1] = ent->colormod[2] = 1;
|
2000-12-11 09:59:27 +00:00
|
|
|
} else {
|
2000-07-01 04:56:13 +00:00
|
|
|
ent->colormod[0] = (float) ((s1->colormod >> 5) & 7) * (1.0 / 7.0);
|
|
|
|
ent->colormod[1] = (float) ((s1->colormod >> 2) & 7) * (1.0 / 7.0);
|
|
|
|
ent->colormod[2] = (float) (s1->colormod & 3) * (1.0 / 3.0);
|
|
|
|
}
|
|
|
|
// Ender: Extend (Colormod) [QSG - End]
|
2000-06-25 13:00:19 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
// set skin
|
2000-05-10 20:33:16 +00:00
|
|
|
ent->skinnum = s1->skinnum;
|
2000-12-08 06:51:37 +00:00
|
|
|
|
2000-05-10 20:33:16 +00:00
|
|
|
// set frame
|
2000-12-11 11:12:48 +00:00
|
|
|
ent->pose1 = ent->pose2 = ent->frame = s1->frame;
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-12-11 09:59:27 +00:00
|
|
|
if (model->flags & EF_ROTATE) { // rotate binary objects locally
|
2000-05-10 20:33:16 +00:00
|
|
|
ent->angles[0] = 0;
|
|
|
|
ent->angles[1] = autorotate;
|
|
|
|
ent->angles[2] = 0;
|
2000-12-08 06:51:37 +00:00
|
|
|
} else {
|
|
|
|
float a1, a2;
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
for (i = 0; i < 3; i++) {
|
2000-05-10 20:33:16 +00:00
|
|
|
a1 = s1->angles[i];
|
|
|
|
a2 = s2->angles[i];
|
|
|
|
if (a1 - a2 > 180)
|
|
|
|
a1 -= 360;
|
|
|
|
if (a1 - a2 < -180)
|
|
|
|
a1 += 360;
|
|
|
|
ent->angles[i] = a2 + f * (a1 - a2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// calculate origin
|
2000-12-08 06:51:37 +00:00
|
|
|
for (i = 0; i < 3; i++)
|
2000-12-11 09:59:27 +00:00
|
|
|
ent->origin[i] = s2->origin[i] + f * (s1->origin[i] - s2->origin[i]);
|
2000-05-10 20:33:16 +00:00
|
|
|
|
|
|
|
// add automatic particle trails
|
|
|
|
if (!model->flags)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
// scan the old entity display list for a matching
|
2000-12-08 06:51:37 +00:00
|
|
|
for (i = 0; i < cl_oldnumvisedicts; i++) {
|
|
|
|
if (cl_oldvisedicts[i].keynum == ent->keynum) {
|
2000-12-11 09:59:27 +00:00
|
|
|
ent->frame_start_time = cl_oldvisedicts[i].frame_start_time;
|
|
|
|
ent->frame_interval = cl_oldvisedicts[i].frame_interval;
|
|
|
|
ent->pose1 = cl_oldvisedicts[i].pose1;
|
|
|
|
ent->pose2 = cl_oldvisedicts[i].pose2;
|
2000-05-10 20:33:16 +00:00
|
|
|
VectorCopy (cl_oldvisedicts[i].origin, old_origin);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2000-12-11 09:59:27 +00:00
|
|
|
|
|
|
|
if (i == cl_oldnumvisedicts) // not in last message
|
|
|
|
continue;
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
for (i = 0; i < 3; i++)
|
|
|
|
if (abs (old_origin[i] - ent->origin[i]) > 128) { // no trail
|
|
|
|
// if too far
|
2000-05-10 20:33:16 +00:00
|
|
|
VectorCopy (ent->origin, old_origin);
|
|
|
|
break;
|
|
|
|
}
|
2000-12-11 09:59:27 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
if (model->flags & EF_ROCKET) {
|
2000-06-19 22:56:28 +00:00
|
|
|
R_RocketTrail (old_origin, ent->origin, 0, ent);
|
2000-05-10 20:33:16 +00:00
|
|
|
dl = CL_AllocDlight (s1->number);
|
|
|
|
VectorCopy (ent->origin, dl->origin);
|
|
|
|
dl->radius = 200;
|
|
|
|
dl->die = cl.time + 0.1;
|
2000-12-08 06:51:37 +00:00
|
|
|
} else if (model->flags & EF_GRENADE)
|
2000-06-19 22:56:28 +00:00
|
|
|
R_RocketTrail (old_origin, ent->origin, 1, ent);
|
2000-05-10 20:33:16 +00:00
|
|
|
else if (model->flags & EF_GIB)
|
2000-06-19 22:56:28 +00:00
|
|
|
R_RocketTrail (old_origin, ent->origin, 2, ent);
|
2000-05-10 20:33:16 +00:00
|
|
|
else if (model->flags & EF_ZOMGIB)
|
2000-06-19 22:56:28 +00:00
|
|
|
R_RocketTrail (old_origin, ent->origin, 4, ent);
|
2000-05-10 20:33:16 +00:00
|
|
|
else if (model->flags & EF_TRACER)
|
2000-06-19 22:56:28 +00:00
|
|
|
R_RocketTrail (old_origin, ent->origin, 3, ent);
|
2000-05-10 20:33:16 +00:00
|
|
|
else if (model->flags & EF_TRACER2)
|
2000-06-19 22:56:28 +00:00
|
|
|
R_RocketTrail (old_origin, ent->origin, 5, ent);
|
2000-05-10 20:33:16 +00:00
|
|
|
else if (model->flags & EF_TRACER3)
|
2000-06-19 22:56:28 +00:00
|
|
|
R_RocketTrail (old_origin, ent->origin, 6, ent);
|
2000-05-10 20:33:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
=========================================================================
|
|
|
|
|
|
|
|
PROJECTILE PARSING / LINKING
|
|
|
|
|
|
|
|
=========================================================================
|
|
|
|
*/
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
typedef struct {
|
|
|
|
int modelindex;
|
|
|
|
vec3_t origin;
|
|
|
|
vec3_t angles;
|
2000-05-10 20:33:16 +00:00
|
|
|
} projectile_t;
|
|
|
|
|
|
|
|
#define MAX_PROJECTILES 32
|
2000-12-08 06:51:37 +00:00
|
|
|
projectile_t cl_projectiles[MAX_PROJECTILES];
|
|
|
|
int cl_num_projectiles;
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
extern int cl_spikeindex;
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
CL_ClearProjectiles (void)
|
2000-05-10 20:33:16 +00:00
|
|
|
{
|
|
|
|
cl_num_projectiles = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
=====================
|
|
|
|
CL_ParseProjectiles
|
|
|
|
|
|
|
|
Nails are passed as efficient temporary entities
|
|
|
|
=====================
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
CL_ParseProjectiles (void)
|
2000-05-10 20:33:16 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
int i, c, j;
|
|
|
|
byte bits[6];
|
|
|
|
projectile_t *pr;
|
2000-05-10 20:33:16 +00:00
|
|
|
|
|
|
|
c = MSG_ReadByte ();
|
2000-12-08 06:51:37 +00:00
|
|
|
for (i = 0; i < c; i++) {
|
|
|
|
for (j = 0; j < 6; j++)
|
2000-05-10 20:33:16 +00:00
|
|
|
bits[j] = MSG_ReadByte ();
|
|
|
|
|
|
|
|
if (cl_num_projectiles == MAX_PROJECTILES)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
pr = &cl_projectiles[cl_num_projectiles];
|
|
|
|
cl_num_projectiles++;
|
|
|
|
|
|
|
|
pr->modelindex = cl_spikeindex;
|
2000-12-08 06:51:37 +00:00
|
|
|
pr->origin[0] = ((bits[0] + ((bits[1] & 15) << 8)) << 1) - 4096;
|
|
|
|
pr->origin[1] = (((bits[1] >> 4) + (bits[2] << 4)) << 1) - 4096;
|
|
|
|
pr->origin[2] = ((bits[3] + ((bits[4] & 15) << 8)) << 1) - 4096;
|
|
|
|
pr->angles[0] = 360 * (bits[4] >> 4) / 16;
|
|
|
|
pr->angles[1] = 360 * bits[5] / 256;
|
2000-05-10 20:33:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
=============
|
|
|
|
CL_LinkProjectiles
|
|
|
|
|
|
|
|
=============
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
CL_LinkProjectiles (void)
|
2000-05-10 20:33:16 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
int i;
|
|
|
|
projectile_t *pr;
|
|
|
|
entity_t *ent;
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
for (i = 0, pr = cl_projectiles; i < cl_num_projectiles; i++, pr++) {
|
2000-07-04 00:49:01 +00:00
|
|
|
if (pr->modelindex < 1)
|
|
|
|
continue;
|
|
|
|
|
2000-05-10 20:33:16 +00:00
|
|
|
// grab an entity to fill in
|
|
|
|
if (cl_numvisedicts == MAX_VISEDICTS)
|
2000-12-08 06:51:37 +00:00
|
|
|
break; // object list is full
|
2000-05-10 20:33:16 +00:00
|
|
|
ent = &cl_visedicts[cl_numvisedicts];
|
|
|
|
cl_numvisedicts++;
|
|
|
|
ent->keynum = 0;
|
|
|
|
ent->model = cl.model_precache[pr->modelindex];
|
|
|
|
ent->skinnum = 0;
|
|
|
|
ent->frame = 0;
|
|
|
|
ent->colormap = vid.colormap;
|
|
|
|
ent->scoreboard = NULL;
|
|
|
|
VectorCopy (pr->origin, ent->origin);
|
|
|
|
VectorCopy (pr->angles, ent->angles);
|
2000-12-08 06:51:37 +00:00
|
|
|
// LordHavoc: Endy had neglected to do this as part of the QSG
|
|
|
|
// VERSION 2 stuff
|
|
|
|
ent->glowsize = 0;
|
|
|
|
ent->glowcolor = 254;
|
|
|
|
ent->alpha = 1;
|
|
|
|
ent->scale = 1;
|
|
|
|
ent->colormod[0] = ent->colormod[1] = ent->colormod[2] = 1;
|
2000-05-10 20:33:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//========================================
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
extern int cl_spikeindex, cl_playerindex, cl_flagindex;
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
entity_t *CL_NewTempEntity (void);
|
2000-05-10 20:33:16 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
===================
|
|
|
|
CL_ParsePlayerinfo
|
|
|
|
===================
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
extern int parsecountmod;
|
2000-05-10 20:33:16 +00:00
|
|
|
extern double parsecounttime;
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
CL_ParsePlayerinfo (void)
|
2000-05-10 20:33:16 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
int msec;
|
|
|
|
int flags;
|
|
|
|
player_info_t *info;
|
|
|
|
player_state_t *state;
|
|
|
|
int num;
|
|
|
|
int i;
|
2000-05-10 20:33:16 +00:00
|
|
|
|
|
|
|
num = MSG_ReadByte ();
|
|
|
|
if (num > MAX_CLIENTS)
|
2000-12-11 09:59:27 +00:00
|
|
|
// Sys_Error ("CL_ParsePlayerinfo: bad num");
|
2000-07-31 12:54:11 +00:00
|
|
|
Host_EndGame ("CL_ParsePlayerinfo: bad num");
|
2000-05-10 20:33:16 +00:00
|
|
|
|
|
|
|
info = &cl.players[num];
|
|
|
|
|
|
|
|
state = &cl.frames[parsecountmod].playerstate[num];
|
|
|
|
|
2000-12-11 09:59:27 +00:00
|
|
|
state->number = num;
|
2000-05-10 20:33:16 +00:00
|
|
|
flags = state->flags = MSG_ReadShort ();
|
|
|
|
|
|
|
|
state->messagenum = cl.parsecount;
|
|
|
|
state->origin[0] = MSG_ReadCoord ();
|
|
|
|
state->origin[1] = MSG_ReadCoord ();
|
|
|
|
state->origin[2] = MSG_ReadCoord ();
|
|
|
|
|
|
|
|
state->frame = MSG_ReadByte ();
|
|
|
|
|
|
|
|
// the other player's last move was likely some time
|
|
|
|
// before the packet was sent out, so accurately track
|
|
|
|
// the exact time it was valid at
|
2000-12-08 06:51:37 +00:00
|
|
|
if (flags & PF_MSEC) {
|
2000-05-10 20:33:16 +00:00
|
|
|
msec = MSG_ReadByte ();
|
2000-12-08 06:51:37 +00:00
|
|
|
state->state_time = parsecounttime - msec * 0.001;
|
|
|
|
} else
|
2000-05-10 20:33:16 +00:00
|
|
|
state->state_time = parsecounttime;
|
|
|
|
|
|
|
|
if (flags & PF_COMMAND)
|
|
|
|
MSG_ReadDeltaUsercmd (&nullcmd, &state->command);
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
for (i = 0; i < 3; i++) {
|
|
|
|
if (flags & (PF_VELOCITY1 << i))
|
|
|
|
state->velocity[i] = MSG_ReadShort ();
|
2000-05-10 20:33:16 +00:00
|
|
|
else
|
|
|
|
state->velocity[i] = 0;
|
|
|
|
}
|
|
|
|
if (flags & PF_MODEL)
|
|
|
|
state->modelindex = MSG_ReadByte ();
|
|
|
|
else
|
|
|
|
state->modelindex = cl_playerindex;
|
|
|
|
|
|
|
|
if (flags & PF_SKINNUM)
|
|
|
|
state->skinnum = MSG_ReadByte ();
|
|
|
|
else
|
|
|
|
state->skinnum = 0;
|
|
|
|
|
|
|
|
if (flags & PF_EFFECTS)
|
|
|
|
state->effects = MSG_ReadByte ();
|
|
|
|
else
|
|
|
|
state->effects = 0;
|
|
|
|
|
|
|
|
if (flags & PF_WEAPONFRAME)
|
|
|
|
state->weaponframe = MSG_ReadByte ();
|
|
|
|
else
|
|
|
|
state->weaponframe = 0;
|
|
|
|
|
|
|
|
VectorCopy (state->command.angles, state->viewangles);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
================
|
|
|
|
CL_AddFlagModels
|
|
|
|
|
|
|
|
Called when the CTF flags are set
|
|
|
|
================
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
CL_AddFlagModels (entity_t *ent, int team)
|
2000-05-10 20:33:16 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
int i;
|
|
|
|
float f;
|
|
|
|
vec3_t v_forward, v_right, v_up;
|
|
|
|
entity_t *newent;
|
2000-05-10 20:33:16 +00:00
|
|
|
|
|
|
|
if (cl_flagindex == -1)
|
|
|
|
return;
|
|
|
|
|
|
|
|
f = 14;
|
|
|
|
if (ent->frame >= 29 && ent->frame <= 40) {
|
2000-12-08 06:51:37 +00:00
|
|
|
if (ent->frame >= 29 && ent->frame <= 34) { // axpain
|
|
|
|
if (ent->frame == 29)
|
|
|
|
f = f + 2;
|
|
|
|
else if (ent->frame == 30)
|
|
|
|
f = f + 8;
|
|
|
|
else if (ent->frame == 31)
|
|
|
|
f = f + 12;
|
|
|
|
else if (ent->frame == 32)
|
|
|
|
f = f + 11;
|
|
|
|
else if (ent->frame == 33)
|
|
|
|
f = f + 10;
|
|
|
|
else if (ent->frame == 34)
|
|
|
|
f = f + 4;
|
|
|
|
} else if (ent->frame >= 35 && ent->frame <= 40) { // pain
|
|
|
|
if (ent->frame == 35)
|
|
|
|
f = f + 2;
|
|
|
|
else if (ent->frame == 36)
|
|
|
|
f = f + 10;
|
|
|
|
else if (ent->frame == 37)
|
|
|
|
f = f + 10;
|
|
|
|
else if (ent->frame == 38)
|
|
|
|
f = f + 8;
|
|
|
|
else if (ent->frame == 39)
|
|
|
|
f = f + 4;
|
|
|
|
else if (ent->frame == 40)
|
|
|
|
f = f + 2;
|
2000-05-10 20:33:16 +00:00
|
|
|
}
|
|
|
|
} else if (ent->frame >= 103 && ent->frame <= 118) {
|
2000-12-08 06:51:37 +00:00
|
|
|
if (ent->frame >= 103 && ent->frame <= 104)
|
|
|
|
f = f + 6; // nailattack
|
|
|
|
else if (ent->frame >= 105 && ent->frame <= 106)
|
|
|
|
f = f + 6; // light
|
|
|
|
else if (ent->frame >= 107 && ent->frame <= 112)
|
|
|
|
f = f + 7; // rocketattack
|
|
|
|
else if (ent->frame >= 112 && ent->frame <= 118)
|
|
|
|
f = f + 7; // shotattack
|
2000-05-10 20:33:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
newent = CL_NewTempEntity ();
|
|
|
|
newent->model = cl.model_precache[cl_flagindex];
|
|
|
|
newent->skinnum = team;
|
|
|
|
|
|
|
|
AngleVectors (ent->angles, v_forward, v_right, v_up);
|
2000-12-08 06:51:37 +00:00
|
|
|
v_forward[2] = -v_forward[2]; // reverse z component
|
|
|
|
for (i = 0; i < 3; i++)
|
|
|
|
newent->origin[i] = ent->origin[i] - f * v_forward[i] + 22 * v_right[i];
|
2000-05-10 20:33:16 +00:00
|
|
|
newent->origin[2] -= 16;
|
|
|
|
|
|
|
|
VectorCopy (ent->angles, newent->angles)
|
2000-12-08 06:51:37 +00:00
|
|
|
newent->angles[2] -= 45;
|
2000-05-10 20:33:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
=============
|
|
|
|
CL_LinkPlayers
|
|
|
|
|
|
|
|
Create visible entities in the correct position
|
|
|
|
for all current players
|
|
|
|
=============
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
CL_LinkPlayers (void)
|
2000-05-10 20:33:16 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
int i, j;
|
|
|
|
player_info_t *info;
|
|
|
|
player_state_t *state;
|
|
|
|
player_state_t exact;
|
|
|
|
double playertime;
|
|
|
|
entity_t *ent;
|
|
|
|
int msec;
|
|
|
|
frame_t *frame;
|
|
|
|
int oldphysent;
|
|
|
|
vec3_t org;
|
2000-05-10 20:33:16 +00:00
|
|
|
|
|
|
|
playertime = realtime - cls.latency + 0.02;
|
|
|
|
if (playertime > realtime)
|
|
|
|
playertime = realtime;
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
frame = &cl.frames[cl.parsecount & UPDATE_MASK];
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
for (j = 0, info = cl.players, state = frame->playerstate; j < MAX_CLIENTS;
|
|
|
|
j++, info++, state++) {
|
2000-05-10 20:33:16 +00:00
|
|
|
if (state->messagenum != cl.parsecount)
|
2000-12-08 06:51:37 +00:00
|
|
|
continue; // not present this frame
|
2000-05-10 20:33:16 +00:00
|
|
|
|
|
|
|
// spawn light flashes, even ones coming from invisible objects
|
2000-10-17 03:17:42 +00:00
|
|
|
if (!gl_flashblend->int_val || j != cl.playernum) {
|
2000-05-22 04:54:06 +00:00
|
|
|
|
|
|
|
if (j == cl.playernum) {
|
|
|
|
VectorCopy (cl.simorg, org);
|
|
|
|
} else
|
|
|
|
VectorCopy (state->origin, org);
|
|
|
|
|
2000-05-10 20:33:16 +00:00
|
|
|
if ((state->effects & (EF_BLUE | EF_RED)) == (EF_BLUE | EF_RED))
|
2000-12-08 06:51:37 +00:00
|
|
|
CL_NewDlight (j, org[0], org[1], org[2], 200 + (rand () & 31),
|
|
|
|
0.1, 3);
|
2000-05-10 20:33:16 +00:00
|
|
|
else if (state->effects & EF_BLUE)
|
2000-12-08 06:51:37 +00:00
|
|
|
CL_NewDlight (j, org[0], org[1], org[2], 200 + (rand () & 31),
|
|
|
|
0.1, 1);
|
2000-05-10 20:33:16 +00:00
|
|
|
else if (state->effects & EF_RED)
|
2000-12-08 06:51:37 +00:00
|
|
|
CL_NewDlight (j, org[0], org[1], org[2], 200 + (rand () & 31),
|
|
|
|
0.1, 2);
|
2000-05-10 20:33:16 +00:00
|
|
|
else if (state->effects & EF_BRIGHTLIGHT)
|
2000-12-08 06:51:37 +00:00
|
|
|
CL_NewDlight (j, org[0], org[1], org[2] + 16,
|
|
|
|
400 + (rand () & 31), 0.1, 0);
|
2000-05-10 20:33:16 +00:00
|
|
|
else if (state->effects & EF_DIMLIGHT)
|
2000-12-08 06:51:37 +00:00
|
|
|
CL_NewDlight (j, org[0], org[1], org[2], 200 + (rand () & 31),
|
|
|
|
0.1, 0);
|
2000-05-10 20:33:16 +00:00
|
|
|
}
|
|
|
|
// the player object never gets added
|
|
|
|
if (j == cl.playernum)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (!state->modelindex)
|
|
|
|
continue;
|
|
|
|
|
2000-10-16 08:15:22 +00:00
|
|
|
// Hack hack hack
|
2000-10-17 03:17:42 +00:00
|
|
|
if (cl_deadbodyfilter->int_val && state->modelindex == cl_playerindex
|
2000-12-08 06:51:37 +00:00
|
|
|
&& ((i = state->frame) == 49 || i == 60 || i == 69 || i == 84
|
|
|
|
|| i == 93 || i == 102))
|
2000-10-16 08:15:22 +00:00
|
|
|
continue;
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
if (!Cam_DrawPlayer (j))
|
2000-05-10 20:33:16 +00:00
|
|
|
continue;
|
|
|
|
|
|
|
|
// grab an entity to fill in
|
2000-12-11 09:59:27 +00:00
|
|
|
if (cl_numvisedicts == MAX_VISEDICTS) // object list is full
|
|
|
|
break;
|
|
|
|
|
2000-05-10 20:33:16 +00:00
|
|
|
ent = &cl_visedicts[cl_numvisedicts];
|
|
|
|
cl_numvisedicts++;
|
|
|
|
|
2000-12-11 09:59:27 +00:00
|
|
|
// scan the old entity display list for a matching player
|
|
|
|
for (i = 0; i < cl_oldnumvisedicts; i++) {
|
|
|
|
if (cl_oldvisedicts[i].keynum == state->number) {
|
|
|
|
ent->frame_start_time = cl_oldvisedicts[i].frame_start_time;
|
|
|
|
ent->frame_interval = cl_oldvisedicts[i].frame_interval;
|
|
|
|
ent->pose1 = cl_oldvisedicts[i].pose1;
|
|
|
|
ent->pose2 = cl_oldvisedicts[i].pose2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ent->keynum = 0;
|
2000-05-10 20:33:16 +00:00
|
|
|
ent->model = cl.model_precache[state->modelindex];
|
|
|
|
ent->skinnum = state->skinnum;
|
2000-12-11 11:12:48 +00:00
|
|
|
ent->pose1 = ent->pose2 = ent->frame = state->frame;
|
|
|
|
ent->frame_start_time = 0;
|
|
|
|
ent->frame_interval = 0;
|
2000-05-10 20:33:16 +00:00
|
|
|
ent->colormap = info->translations;
|
|
|
|
if (state->modelindex == cl_playerindex)
|
|
|
|
ent->scoreboard = info; // use custom skin
|
|
|
|
else
|
|
|
|
ent->scoreboard = NULL;
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
// LordHavoc: more QSG VERSION 2 stuff, FIXME: players don't have
|
|
|
|
// extend stuff
|
|
|
|
ent->glowsize = 0;
|
|
|
|
ent->glowcolor = 254;
|
|
|
|
ent->alpha = 1;
|
|
|
|
ent->scale = 1;
|
2000-07-02 14:14:56 +00:00
|
|
|
ent->colormod[0] = ent->colormod[1] = ent->colormod[2] = 1;
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
//
|
2000-05-10 20:33:16 +00:00
|
|
|
// angles
|
2000-12-08 06:51:37 +00:00
|
|
|
//
|
|
|
|
ent->angles[PITCH] = -state->viewangles[PITCH] / 3;
|
2000-05-10 20:33:16 +00:00
|
|
|
ent->angles[YAW] = state->viewangles[YAW];
|
|
|
|
ent->angles[ROLL] = 0;
|
2000-12-08 06:51:37 +00:00
|
|
|
ent->angles[ROLL] = V_CalcRoll (ent->angles, state->velocity) * 4;
|
2000-05-10 20:33:16 +00:00
|
|
|
|
|
|
|
// only predict half the move to minimize overruns
|
2000-12-08 06:51:37 +00:00
|
|
|
msec = 500 * (playertime - state->state_time);
|
2000-12-11 09:59:27 +00:00
|
|
|
if (msec <= 0 || (!cl_predict_players->int_val && !cl_predict_players2->int_val)) {
|
2000-05-10 20:33:16 +00:00
|
|
|
VectorCopy (state->origin, ent->origin);
|
2000-12-11 09:59:27 +00:00
|
|
|
} else { // predict players movement
|
|
|
|
state->command.msec = msec = min (msec, 255);
|
2000-05-10 20:33:16 +00:00
|
|
|
|
|
|
|
oldphysent = pmove.numphysent;
|
|
|
|
CL_SetSolidPlayers (j);
|
|
|
|
CL_PredictUsercmd (state, &exact, &state->command, false);
|
|
|
|
pmove.numphysent = oldphysent;
|
|
|
|
VectorCopy (exact.origin, ent->origin);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (state->effects & EF_FLAG1)
|
|
|
|
CL_AddFlagModels (ent, 0);
|
|
|
|
else if (state->effects & EF_FLAG2)
|
|
|
|
CL_AddFlagModels (ent, 1);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//======================================================================
|
|
|
|
|
|
|
|
/*
|
|
|
|
===============
|
|
|
|
CL_SetSolid
|
|
|
|
|
|
|
|
Builds all the pmove physents for the current frame
|
|
|
|
===============
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
CL_SetSolidEntities (void)
|
2000-05-10 20:33:16 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
int i;
|
|
|
|
frame_t *frame;
|
|
|
|
packet_entities_t *pak;
|
|
|
|
entity_state_t *state;
|
2000-05-10 20:33:16 +00:00
|
|
|
|
|
|
|
pmove.physents[0].model = cl.worldmodel;
|
|
|
|
VectorCopy (vec3_origin, pmove.physents[0].origin);
|
|
|
|
pmove.physents[0].info = 0;
|
|
|
|
pmove.numphysent = 1;
|
|
|
|
|
|
|
|
frame = &cl.frames[parsecountmod];
|
|
|
|
pak = &frame->packet_entities;
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
for (i = 0; i < pak->num_entities; i++) {
|
2000-05-10 20:33:16 +00:00
|
|
|
state = &pak->entities[i];
|
|
|
|
|
|
|
|
if (!state->modelindex)
|
|
|
|
continue;
|
|
|
|
if (!cl.model_precache[state->modelindex])
|
|
|
|
continue;
|
2000-12-08 06:51:37 +00:00
|
|
|
if (cl.model_precache[state->modelindex]->hulls[1].firstclipnode
|
|
|
|
|| cl.model_precache[state->modelindex]->clipbox) {
|
|
|
|
pmove.physents[pmove.numphysent].model =
|
|
|
|
cl.model_precache[state->modelindex];
|
2000-05-10 20:33:16 +00:00
|
|
|
VectorCopy (state->origin, pmove.physents[pmove.numphysent].origin);
|
|
|
|
pmove.numphysent++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
===
|
|
|
|
Calculate the new position of players, without other player clipping
|
|
|
|
|
|
|
|
We do this to set up real player prediction.
|
|
|
|
Players are predicted twice, first without clipping other players,
|
|
|
|
then with clipping against them.
|
|
|
|
This sets up the first phase.
|
|
|
|
===
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
CL_SetUpPlayerPrediction (qboolean dopred)
|
2000-05-10 20:33:16 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
int j;
|
|
|
|
player_state_t *state;
|
|
|
|
player_state_t exact;
|
|
|
|
double playertime;
|
|
|
|
int msec;
|
|
|
|
frame_t *frame;
|
2000-05-10 20:33:16 +00:00
|
|
|
struct predicted_player *pplayer;
|
|
|
|
|
|
|
|
playertime = realtime - cls.latency + 0.02;
|
|
|
|
if (playertime > realtime)
|
|
|
|
playertime = realtime;
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
frame = &cl.frames[cl.parsecount & UPDATE_MASK];
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
for (j = 0, pplayer = predicted_players, state = frame->playerstate;
|
|
|
|
j < MAX_CLIENTS; j++, pplayer++, state++) {
|
2000-05-10 20:33:16 +00:00
|
|
|
|
|
|
|
pplayer->active = false;
|
|
|
|
|
|
|
|
if (state->messagenum != cl.parsecount)
|
2000-12-08 06:51:37 +00:00
|
|
|
continue; // not present this frame
|
2000-05-10 20:33:16 +00:00
|
|
|
|
|
|
|
if (!state->modelindex)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
pplayer->active = true;
|
|
|
|
pplayer->flags = state->flags;
|
|
|
|
|
|
|
|
// note that the local player is special, since he moves locally
|
|
|
|
// we use his last predicted postition
|
|
|
|
if (j == cl.playernum) {
|
2000-12-08 06:51:37 +00:00
|
|
|
VectorCopy (cl.frames[cls.netchan.outgoing_sequence & UPDATE_MASK].
|
|
|
|
playerstate[cl.playernum].origin, pplayer->origin);
|
2000-05-10 20:33:16 +00:00
|
|
|
} else {
|
|
|
|
// only predict half the move to minimize overruns
|
2000-12-08 06:51:37 +00:00
|
|
|
msec = 500 * (playertime - state->state_time);
|
2000-05-10 20:33:16 +00:00
|
|
|
if (msec <= 0 ||
|
2000-12-08 06:51:37 +00:00
|
|
|
(!cl_predict_players->int_val && !cl_predict_players2->int_val)
|
|
|
|
|| !dopred) {
|
2000-05-10 20:33:16 +00:00
|
|
|
VectorCopy (state->origin, pplayer->origin);
|
2000-12-08 06:51:37 +00:00
|
|
|
// Con_DPrintf ("nopredict\n");
|
|
|
|
} else {
|
2000-05-10 20:33:16 +00:00
|
|
|
// predict players movement
|
2000-12-11 09:59:27 +00:00
|
|
|
state->command.msec = msec = min (msec, 255);
|
2000-12-08 06:51:37 +00:00
|
|
|
// Con_DPrintf ("predict: %i\n", msec);
|
2000-05-10 20:33:16 +00:00
|
|
|
|
|
|
|
CL_PredictUsercmd (state, &exact, &state->command, false);
|
|
|
|
VectorCopy (exact.origin, pplayer->origin);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
===============
|
|
|
|
CL_SetSolid
|
|
|
|
|
|
|
|
Builds all the pmove physents for the current frame
|
|
|
|
Note that CL_SetUpPlayerPrediction() must be called first!
|
|
|
|
pmove must be setup with world and solid entity hulls before calling
|
|
|
|
(via CL_PredictMove)
|
|
|
|
===============
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
CL_SetSolidPlayers (int playernum)
|
2000-05-10 20:33:16 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
int j;
|
|
|
|
extern vec3_t player_mins;
|
|
|
|
extern vec3_t player_maxs;
|
2000-05-10 20:33:16 +00:00
|
|
|
struct predicted_player *pplayer;
|
2000-12-08 06:51:37 +00:00
|
|
|
physent_t *pent;
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-10-17 03:17:42 +00:00
|
|
|
if (!cl_solid_players->int_val)
|
2000-05-10 20:33:16 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
pent = pmove.physents + pmove.numphysent;
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
for (j = 0, pplayer = predicted_players; j < MAX_CLIENTS; j++, pplayer++) {
|
2000-05-10 20:33:16 +00:00
|
|
|
|
|
|
|
if (!pplayer->active)
|
2000-12-08 06:51:37 +00:00
|
|
|
continue; // not present this frame
|
2000-05-10 20:33:16 +00:00
|
|
|
|
|
|
|
// the player object never gets added
|
|
|
|
if (j == playernum)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (pplayer->flags & PF_DEAD)
|
2000-12-08 06:51:37 +00:00
|
|
|
continue; // dead players aren't solid
|
2000-05-10 20:33:16 +00:00
|
|
|
|
|
|
|
pent->model = 0;
|
2000-12-08 06:51:37 +00:00
|
|
|
VectorCopy (pplayer->origin, pent->origin);
|
|
|
|
VectorCopy (player_mins, pent->mins);
|
|
|
|
VectorCopy (player_maxs, pent->maxs);
|
2000-05-10 20:33:16 +00:00
|
|
|
pmove.numphysent++;
|
|
|
|
pent++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
===============
|
|
|
|
CL_EmitEntities
|
|
|
|
|
|
|
|
Builds the visedicts array for cl.time
|
|
|
|
|
|
|
|
Made up of: clients, packet_entities, nails, and tents
|
|
|
|
===============
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
CL_EmitEntities (void)
|
2000-05-10 20:33:16 +00:00
|
|
|
{
|
|
|
|
if (cls.state != ca_active)
|
|
|
|
return;
|
|
|
|
if (!cl.validsequence)
|
|
|
|
return;
|
|
|
|
|
|
|
|
cl_oldnumvisedicts = cl_numvisedicts;
|
2000-12-11 09:59:27 +00:00
|
|
|
cl_oldvisedicts = cl_visedicts_list[(cls.netchan.incoming_sequence - 1) & 1];
|
2000-12-08 06:51:37 +00:00
|
|
|
cl_visedicts = cl_visedicts_list[cls.netchan.incoming_sequence & 1];
|
2000-05-10 20:33:16 +00:00
|
|
|
|
|
|
|
cl_numvisedicts = 0;
|
|
|
|
|
|
|
|
CL_LinkPlayers ();
|
|
|
|
CL_LinkPacketEntities ();
|
|
|
|
CL_LinkProjectiles ();
|
|
|
|
CL_UpdateTEnts ();
|
|
|
|
}
|