2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2025-01-16 21:29:55 +01:00

engine: common: don't uselessly copy data in Netchan_OutOfBound when playing a demo

This commit is contained in:
Alibek Omarov 2024-08-07 02:28:58 +03:00
parent b2d184cfa5
commit 8994f079a5

View File

@ -462,17 +462,17 @@ void Netchan_OutOfBand( int net_socket, netadr_t adr, int length, byte *data )
byte send_buf[MAX_PRINT_MSG];
sizebuf_t send;
if( CL_IsPlaybackDemo( ))
return;
// write the packet header
MSG_Init( &send, "SequencePacket", send_buf, sizeof( send_buf ));
MSG_WriteLong( &send, NET_HEADER_OUTOFBANDPACKET ); // -1 sequence means out of band
MSG_WriteBytes( &send, data, length );
if( !CL_IsPlaybackDemo( ))
{
// send the datagram
NET_SendPacket( net_socket, MSG_GetNumBytesWritten( &send ), MSG_GetData( &send ), adr );
}
// send the datagram
NET_SendPacket( net_socket, MSG_GetNumBytesWritten( &send ), MSG_GetData( &send ), adr );
}
/*