From b42b5269e0ad5b22acd6043429ec4013a4e76ddd Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Fri, 24 Oct 2014 20:14:47 -0400 Subject: strife: Allow inventory items > 255. The 'inventory' field in ticcmd structures can refer to inventory values greater than the 8-bit range, so this needs to be transferred over the network as at least a 16-bit value in order to avoid network desyncs. This fixes #454 (thanks Quasar). --- src/net_structrw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/net_structrw.c b/src/net_structrw.c index 2284c6df..60316dc7 100644 --- a/src/net_structrw.c +++ b/src/net_structrw.c @@ -192,7 +192,7 @@ void NET_WriteTiccmdDiff(net_packet_t *packet, net_ticdiff_t *diff, if (diff->diff & NET_TICDIFF_STRIFE) { NET_WriteInt8(packet, diff->cmd.buttons2); - NET_WriteInt8(packet, diff->cmd.inventory); + NET_WriteInt16(packet, diff->cmd.inventory); } } @@ -277,7 +277,7 @@ boolean NET_ReadTiccmdDiff(net_packet_t *packet, net_ticdiff_t *diff, return false; diff->cmd.buttons2 = val; - if (!NET_ReadInt8(packet, &val)) + if (!NET_ReadInt16(packet, &val)) return false; diff->cmd.inventory = val; } -- cgit v1.2.3