diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index f49e4e8d2..018da4539 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -171,6 +171,11 @@ int CL_IsDevOverviewMode( void ) return 0; } +connprotocol_t CL_Protocol( void ) +{ + return cls.legacymode; +} + /* =============== CL_CheckClientState diff --git a/engine/client/cl_parse_48.c b/engine/client/cl_parse_48.c index 87b01bd28..4350192fd 100644 --- a/engine/client/cl_parse_48.c +++ b/engine/client/cl_parse_48.c @@ -658,8 +658,3 @@ void CL_LegacyPrecache_f( void ) MSG_WriteStringf( &cls.netchan.message, "begin %i", spawncount ); cls.signon = SIGNONS - 1; } - -qboolean CL_LegacyMode( void ) -{ - return cls.legacymode == PROTO_LEGACY; -} diff --git a/engine/client/client.h b/engine/client/client.h index 9eb97349c..1012f5938 100644 --- a/engine/client/client.h +++ b/engine/client/client.h @@ -308,14 +308,6 @@ typedef enum CL_CHANGELEVEL, // draw 'loading' during changelevel } scrstate_t; -typedef enum -{ - PROTO_CURRENT = 0, // Xash3D 49 - PROTO_LEGACY = 1, // Xash3D 48 - PROTO_QUAKE = 2, // Quake 15 - PROTO_GOLDSRC = 3, // GoldSrc 48 -} connprotocol_t; - typedef struct { char name[32]; diff --git a/engine/common/common.h b/engine/common/common.h index 0d32d0936..10dea4d18 100644 --- a/engine/common/common.h +++ b/engine/common/common.h @@ -670,6 +670,15 @@ void HPAK_FlushHostQueue( void ); #define INPUT_DEVICE_JOYSTICK (1<<2) #define INPUT_DEVICE_VR (1<<3) + +typedef enum connprotocol_e +{ + PROTO_CURRENT = 0, // Xash3D 49 + PROTO_LEGACY, // Xash3D 48 + PROTO_QUAKE, // Quake 15 + PROTO_GOLDSRC, // GoldSrc 48 +} connprotocol_t; + // shared calls struct physent_s; struct sv_client_s; @@ -768,6 +777,15 @@ int COM_CompareFileTime( const char *filename1, const char *filename2, int *iCom char *va( const char *format, ... ) _format( 1 ); qboolean CRC32_MapFile( dword *crcvalue, const char *filename, qboolean multiplayer ); +#if !XASH_DEDICATED +connprotocol_t CL_Protocol( void ); +#else +static inline connprotocol_t CL_Protocol( void ) +{ + return PROTO_CURRENT; +} +#endif + static inline qboolean Host_IsLocalGame( void ) { if( SV_Active( )) diff --git a/engine/common/net_ws.c b/engine/common/net_ws.c index 28ae36bdb..239e036c0 100644 --- a/engine/common/net_ws.c +++ b/engine/common/net_ws.c @@ -1475,7 +1475,7 @@ static qboolean NET_QueuePacket( netsrc_t sock, netadr_t *from, byte *data, size memcpy( data, buf, ret ); *length = ret; #if !XASH_DEDICATED - if( CL_LegacyMode( )) + if( CL_Protocol( ) == PROTO_LEGACY ) return NET_LagPacket( true, sock, from, length, data ); // check for split message diff --git a/engine/common/net_ws.h b/engine/common/net_ws.h index 046caa96a..ba3808248 100644 --- a/engine/common/net_ws.h +++ b/engine/common/net_ws.h @@ -78,7 +78,6 @@ void NET_IP6BytesToNetadr( netadr_t *adr, const uint8_t *ip6 ); void NET_NetadrToIP6Bytes( uint8_t *ip6, const netadr_t *adr ); #if !XASH_DEDICATED -qboolean CL_LegacyMode( void ); int CL_GetSplitSize( void ); #endif