summaryrefslogtreecommitdiff
path: root/network_data.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-02-06 09:18:04 +0000
committertron <tron@openttd.org>2006-02-06 09:18:04 +0000
commit453b30e387f8d8ab1839d96b0d1f9a8fea841292 (patch)
tree3a4002304d8204d11c37ba706d6ffbd2e5dfac1b /network_data.c
parent0755bbead0240f519c9d78bb88ef4629d5ab8fa5 (diff)
downloadopenttd-453b30e387f8d8ab1839d96b0d1f9a8fea841292.tar.xz
(svn r3564) Several smaller changes:
- Don't treat non-booleans as booleans - Reduce variable scope - Bracing - Use DeMorgan's law to make conditionals easier to read - if cascade -> switch - Replace some magic numbers by symbolic names - Avoid assignments within other statements
Diffstat (limited to 'network_data.c')
-rw-r--r--network_data.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/network_data.c b/network_data.c
index 827081a4e..ffb4bdddc 100644
--- a/network_data.c
+++ b/network_data.c
@@ -100,8 +100,8 @@ void NetworkSend_Packet(Packet *packet, NetworkClientState *cs)
packet->pos = 0;
packet->next = NULL;
- packet->buffer[0] = packet->size & 0xFF;
- packet->buffer[1] = packet->size >> 8;
+ packet->buffer[0] = GB(packet->size, 0, 8);
+ packet->buffer[1] = GB(packet->size, 8, 8);
// Locate last packet buffered for the client
p = cs->packet_queue;