// (which would be remove world entity, but is actually a terminator)
while ((n = (unsigned short)MSG_ReadShort()) != 0x8000 && !msg_badread)
@@ -1933,7+2017,7 @@ void EntityFrame5_AckFrame(entityframe5_database_t *d, int framenum)
int entityframe5_prioritychaincounts[E5_PROTOCOL_PRIORITYLEVELS];
unsigned short entityframe5_prioritychains[E5_PROTOCOL_PRIORITYLEVELS][ENTITYFRAME5_MAXSTATES];
-void EntityFrame5_WriteFrame(sizebuf_t *msg, entityframe5_database_t *d, int numstates, const entity_state_t *states, int viewentnum, int *stats)
+void EntityFrame5_WriteFrame(sizebuf_t *msg, entityframe5_database_t *d, int numstates, const entity_state_t *states, int viewentnum, int *stats, int movesequence)
{
const entity_state_t *n;
int i, num, l, framenum, packetlognumber, priority;
@@ -1941,8+2025,8 @@ void EntityFrame5_WriteFrame(sizebuf_t *msg, entityframe5_database_t *d, int num
@@ -1954,6+2038,7 @@ void EntityFrame5_WriteFrame(sizebuf_t *msg, entityframe5_database_t *d, int num
break;
if (packetlognumber == ENTITYFRAME5_MAXPACKETLOGS)
{
+ Con_DPrintf("EntityFrame5_WriteFrame: packetlog overflow for a client, resetting\n");
EntityFrame5_LostFrame(d, framenum);
packetlognumber = 0;
}
@@ -2006,8+2091,7 @@ void EntityFrame5_WriteFrame(sizebuf_t *msg, entityframe5_database_t *d, int num
num++;
}
// all remaining entities are dead
- // note: this must use sv.max_edicts, not sv.num_edicts, because sv.num_edicts can both increase and decrease, where as sv.max_edicts only increases (if sv.num_edicts is used, sometimes some entities are missed when the sv.num_edicts count goes back down after firing some shots)
- for (;num < sv.max_edicts;num++)
+ for (;num < d->maxedicts;num++)
{
if (CHECKPVSBIT(d->visiblebits, num))
{
@@ -2019,10+2103,15 @@ void EntityFrame5_WriteFrame(sizebuf_t *msg, entityframe5_database_t *d, int num
}
}
+ // if there isn't at least enough room for an empty svc_entities,