5{
6 int i,
n, cnumber, referenceframenum, framenum, enumber, done, stopnumber, skip =
false;
9 if (!
cl.entitydatabase4)
11 d =
cl.entitydatabase4;
12
14
17
20 {
26 }
28 {
29 Con_Print(
"EntityFrame4_CL_ReadFrame: reference frame invalid (VERY BAD ERROR), this update will be skipped\n");
30 skip = true;
31 }
34 {
36 {
40 }
41 }
43 {
44 Con_Printf(
"EntityFrame4_CL_ReadFrame: error while decoding frame %i: database full, reading but not storing this update\n", framenum);
45 skip = true;
46 }
47 done = false;
49 {
50
51
54 {
55
56
57 done = true;
58
60 }
61
63
64 if (
cl.num_entities <= cnumber && !(
n & 0x8000))
65 {
66 cl.num_entities = cnumber + 1;
67 if (cnumber >=
cl.max_entities)
69 }
70
71 stopnumber = cnumber + !done;
72
73 for (;enumber < stopnumber;enumber++)
74 {
75 if (skip || enumber >=
cl.num_entities)
76 {
77 if (enumber == cnumber && (
n & 0x8000) == 0)
78 {
81 }
82 continue;
83 }
84
85 cl.entities[enumber].state_previous =
cl.entities[enumber].state_current;
86
88 s = &
cl.entities[enumber].state_current;
89
90 if (enumber == cnumber)
91 {
93 {
94
98 }
99 else
100 {
101
106 }
107 }
110
112
114
116
119
122
124 {
126 Con_Printf(
"entity #%i has become active\n", enumber);
127 else if (
cl.entities[enumber].state_previous.active)
128 Con_Printf(
"entity #%i has become inactive\n", enumber);
129 }
130 }
131 }
133 if (skip)
135}
void EntityState_ReadFields(entity_state_t *e, unsigned int bits)
int EntityState_ReadExtendBits(void)
void CL_ExpandEntities(int num)
void CL_MoveLerpEntityStates(entity_t *ent)
cvar_t developer_networkentities
int EntityFrame4_AckFrame(entityframe4_database_t *d, int framenum, int servermode)
entityframe4_database_t * EntityFrame4_AllocDatabase(mempool_t *pool)
void EntityFrame4_ResetDatabase(entityframe4_database_t *d)
entity_state_t * EntityFrame4_GetReferenceEntity(entityframe4_database_t *d, int number)
void EntityFrame4_AddCommitEntity(entityframe4_database_t *d, const entity_state_t *s)
void Con_Print(const char *msg)
Prints to all appropriate console targets, and adds timestamps.
void Con_Printf(const char *fmt,...)
Prints to all appropriate console targets.
entity_state_t defaultstate
#define MAX_ENTITY_HISTORY
entity_database4_commit_t commit[MAX_ENTITY_HISTORY]
entity_database4_commit_t * currentcommit