aboutsummaryrefslogtreecommitdiffhomepage
path: root/protocol.c
diff options
context:
space:
mode:
authorlsalzman <[email protected]>2013-02-27 16:29:22 +0200
committerlsalzman <[email protected]>2013-02-27 16:29:22 +0200
commit4ce4aac14954ee9c302708468ec6c0efd3a1ac2f (patch)
tree9b1d3003db23130c3461e501e885a28261fb8a1c /protocol.c
parent8ff344897a5937b45820b42127b70e1938f97ed0 (diff)
downloadenet-4ce4aac14954ee9c302708468ec6c0efd3a1ac2f.tar.gz
enet-4ce4aac14954ee9c302708468ec6c0efd3a1ac2f.zip
added ENET_PACKET_FLAG_SENT to indicate that a packet has been sent
Diffstat (limited to 'protocol.c')
-rw-r--r--protocol.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/protocol.c b/protocol.c
index f951ac9..d6cc33a 100644
--- a/protocol.c
+++ b/protocol.c
@@ -163,7 +163,11 @@ enet_protocol_remove_sent_unreliable_commands (ENetPeer * peer)
-- outgoingCommand -> packet -> referenceCount;
if (outgoingCommand -> packet -> referenceCount == 0)
- enet_packet_destroy (outgoingCommand -> packet);
+ {
+ outgoingCommand -> packet -> flags |= ENET_PACKET_FLAG_SENT;
+
+ enet_packet_destroy (outgoingCommand -> packet);
+ }
}
enet_free (outgoingCommand);
@@ -237,7 +241,11 @@ enet_protocol_remove_sent_reliable_command (ENetPeer * peer, enet_uint16 reliabl
-- outgoingCommand -> packet -> referenceCount;
if (outgoingCommand -> packet -> referenceCount == 0)
- enet_packet_destroy (outgoingCommand -> packet);
+ {
+ outgoingCommand -> packet -> flags |= ENET_PACKET_FLAG_SENT;
+
+ enet_packet_destroy (outgoingCommand -> packet);
+ }
}
enet_free (outgoingCommand);