From ddd7989b8583293665ec21c15a1289a3f2c1e76f Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 29 Oct 2001 21:46:00 +0000 Subject: [PATCH] turns out I was wrong about how U_REMOVE gets into an update packet (thanks Rhamph) but the change from short to int in words does a nice bit to the speed. --- qw/include/net_svc.h | 4 ++-- qw/source/net_svc.c | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/qw/include/net_svc.h b/qw/include/net_svc.h index 891f52572..34fe00f43 100644 --- a/qw/include/net_svc.h +++ b/qw/include/net_svc.h @@ -180,7 +180,7 @@ typedef struct net_svc_soundlist_s typedef struct net_svc_packetentities_s { int numwords, numdeltas; - unsigned short words[MAX_PACKET_ENTITIES + 1]; + unsigned int words[MAX_PACKET_ENTITIES * 2 + 1]; entity_state_t deltas[MAX_PACKET_ENTITIES]; } net_svc_packetentities_t; @@ -188,7 +188,7 @@ typedef struct net_svc_deltapacketentities_s { int numwords, numdeltas; byte from; - unsigned short words[MAX_PACKET_ENTITIES + 1]; + unsigned int words[MAX_PACKET_ENTITIES * 2 + 1]; entity_state_t deltas[MAX_PACKET_ENTITIES]; } net_svc_deltapacketentities_t; diff --git a/qw/source/net_svc.c b/qw/source/net_svc.c index c2f5c5d0f..d7aa643ab 100644 --- a/qw/source/net_svc.c +++ b/qw/source/net_svc.c @@ -485,7 +485,7 @@ NET_SVC_PacketEntities_Parse (net_svc_packetentities_t *block, msg_t *msg) unsigned short bits; for (word = 0, delta = 0; !msg->badread; word++) { - if (word >= MAX_PACKET_ENTITIES) + if (word >= MAX_PACKET_ENTITIES * 2) return 1; // FIXME: differentiate from short packet bits = (unsigned short) MSG_ReadShort (msg); block->words[word] = bits; @@ -499,7 +499,6 @@ NET_SVC_PacketEntities_Parse (net_svc_packetentities_t *block, msg_t *msg) } } - block->words[word] = 0; block->numwords = word; block->numdeltas = delta; @@ -515,7 +514,7 @@ NET_SVC_DeltaPacketEntities_Parse (net_svc_deltapacketentities_t *block, block->from = MSG_ReadByte (msg); for (word = 0, delta = 0; !msg->badread; word++) { - if (word >= MAX_PACKET_ENTITIES) + if (word >= MAX_PACKET_ENTITIES * 2) return 1; // FIXME: differentiate from short packet bits = (unsigned short) MSG_ReadShort (msg); block->words[word] = bits; @@ -529,7 +528,6 @@ NET_SVC_DeltaPacketEntities_Parse (net_svc_deltapacketentities_t *block, } } - block->words[word] = 0; block->numwords = word; block->numdeltas = delta;