diff options
author | Simon Howard | 2014-10-24 20:14:47 -0400 |
---|---|---|
committer | Simon Howard | 2014-10-24 20:14:47 -0400 |
commit | b42b5269e0ad5b22acd6043429ec4013a4e76ddd (patch) | |
tree | d3b41237c1122aae43cdba87a11ad99e28cb0552 | |
parent | 88b562df34f7843a5146203962c11ce18c6656ce (diff) | |
download | chocolate-doom-b42b5269e0ad5b22acd6043429ec4013a4e76ddd.tar.gz chocolate-doom-b42b5269e0ad5b22acd6043429ec4013a4e76ddd.tar.bz2 chocolate-doom-b42b5269e0ad5b22acd6043429ec4013a4e76ddd.zip |
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).
-rw-r--r-- | src/net_structrw.c | 4 |
1 files 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; } |