From ae1162d907bc2764402ceaa95846056bbb3b66c3 Mon Sep 17 00:00:00 2001 From: Alexander 'z33ky' Hirsch <1zeeky@gmail.com> Date: Sun, 14 Jun 2020 11:00:04 +0200 Subject: [PATCH] Fix compilation without MAPBASE_RPC --- sp/src/game/shared/mapbase/mapbase_rpc.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/sp/src/game/shared/mapbase/mapbase_rpc.cpp b/sp/src/game/shared/mapbase/mapbase_rpc.cpp index 592060ef..96a79ec0 100644 --- a/sp/src/game/shared/mapbase/mapbase_rpc.cpp +++ b/sp/src/game/shared/mapbase/mapbase_rpc.cpp @@ -83,8 +83,6 @@ static const char *g_pszRPCNames[] = { // There can be only one...for each RPC. static EHANDLE g_Metadata[NUM_RPCS]; -#define CMapbaseMetadata C_MapbaseMetadata - // Don't update constantly #define RPC_UPDATE_COOLDOWN 5.0f @@ -92,6 +90,10 @@ static EHANDLE g_Metadata[NUM_RPCS]; #define RPC_UPDATE_WAIT 0.25f #endif +#ifdef CLIENT_DLL +#define CMapbaseMetadata C_MapbaseMetadata +#endif + class CMapbaseMetadata : public CBaseEntity { public: @@ -101,6 +103,7 @@ public: DECLARE_NETWORKCLASS(); DECLARE_CLASS( CMapbaseMetadata, CBaseEntity ); +#ifdef MAPBASE_RPC #ifdef CLIENT_DLL ~C_MapbaseMetadata() { @@ -174,15 +177,18 @@ public: return SetTransmitState( FL_EDICT_ALWAYS ); } #endif +#endif #ifdef CLIENT_DLL - // Built-in update spam limiter - float m_flRPCUpdateTimer = RPC_UPDATE_COOLDOWN; - char m_iszRPCState[128]; char m_iszRPCDetails[128]; +#ifdef MAPBASE_RPC + // Built-in update spam limiter + float m_flRPCUpdateTimer = RPC_UPDATE_COOLDOWN; + int m_spawnflags; +#endif #else CNetworkVar( string_t, m_iszRPCState ); CNetworkVar( string_t, m_iszRPCDetails ); @@ -198,6 +204,7 @@ IMPLEMENT_NETWORKCLASS_ALIASED(MapbaseMetadata, DT_MapbaseMetadata) BEGIN_NETWORK_TABLE_NOBASE(CMapbaseMetadata, DT_MapbaseMetadata) +#ifdef MAPBASE_RPC #ifdef CLIENT_DLL RecvPropString(RECVINFO(m_iszRPCState)), RecvPropString(RECVINFO(m_iszRPCDetails)), @@ -207,6 +214,7 @@ BEGIN_NETWORK_TABLE_NOBASE(CMapbaseMetadata, DT_MapbaseMetadata) SendPropStringT(SENDINFO(m_iszRPCDetails) ), SendPropInt( SENDINFO(m_spawnflags), 8, SPROP_UNSIGNED ), #endif +#endif END_NETWORK_TABLE()