From a0c29e7dd67abb15c74c85f07741784877edfdcd Mon Sep 17 00:00:00 2001 From: Joe Ludwig Date: Mon, 2 Sep 2013 11:39:10 -0700 Subject: General: * Fixed a variety of server browser issues with mods based on this SDK * Fixed many warnings on various platforms * Added source code for fgdlib and raytrace * Updated many source files with the latest shared source from TF2. OSX: * Added support for Xcode 4.6 * Switched OSX builds to use Xcode instead of makefiles * Moved libs from src/lib/osx32 to src/lib/public/osx32 or src/lib/common/osx32 to match windows better. Linux: * Moved libs from src/lib/linux32 to src/lib/public/linux32 or src/lib/common/linux32 to match windows better. --- sp/src/game/server/baseentity.cpp | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) (limited to 'sp/src/game/server/baseentity.cpp') diff --git a/sp/src/game/server/baseentity.cpp b/sp/src/game/server/baseentity.cpp index 689aa020..48f1a4a7 100644 --- a/sp/src/game/server/baseentity.cpp +++ b/sp/src/game/server/baseentity.cpp @@ -653,7 +653,7 @@ void CBaseEntity::SetModelIndex( int index ) void CBaseEntity::ClearModelIndexOverrides( void ) { #ifdef TF_DLL - for ( int index = 0 ; index < MAX_MODEL_INDEX_OVERRIDES ; index++ ) + for ( int index = 0 ; index < MAX_VISION_MODES ; index++ ) { m_nModelIndexOverrides.Set( index, 0 ); } @@ -663,7 +663,7 @@ void CBaseEntity::ClearModelIndexOverrides( void ) void CBaseEntity::SetModelIndexOverride( int index, int nValue ) { #ifdef TF_DLL - if ( ( index >= MODEL_INDEX_OVERRIDE_DEFAULT ) && ( index < MAX_MODEL_INDEX_OVERRIDES ) ) + if ( ( index >= VISION_MODE_NONE ) && ( index < MAX_VISION_MODES ) ) { if ( nValue != m_nModelIndexOverrides[index] ) { @@ -1950,7 +1950,7 @@ BEGIN_DATADESC_NO_BASE( CBaseEntity ) // DEFINE_FIELD( m_fDataObjectTypes, FIELD_INTEGER ), #ifdef TF_DLL - DEFINE_ARRAY( m_nModelIndexOverrides, FIELD_INTEGER, MAX_MODEL_INDEX_OVERRIDES ), + DEFINE_ARRAY( m_nModelIndexOverrides, FIELD_INTEGER, MAX_VISION_MODES ), #endif END_DATADESC() @@ -7302,6 +7302,30 @@ void CC_Ent_Create( const CCommand& args ) { MDLCACHE_CRITICAL_SECTION(); + CBasePlayer *pPlayer = UTIL_GetCommandClient(); + if (!pPlayer) + { + return; + } + + // Don't allow regular users to create point_servercommand entities for the same reason as blocking ent_fire + if ( !Q_stricmp( args[1], "point_servercommand" ) ) + { + if ( engine->IsDedicatedServer() ) + { + // We allow people with disabled autokick to do it, because they already have rcon. + if ( pPlayer->IsAutoKickDisabled() == false ) + return; + } + else if ( gpGlobals->maxClients > 1 ) + { + // On listen servers with more than 1 player, only allow the host to create point_servercommand. + CBasePlayer *pHostPlayer = UTIL_GetListenServerHost(); + if ( pPlayer != pHostPlayer ) + return; + } + } + bool allowPrecache = CBaseEntity::IsPrecacheAllowed(); CBaseEntity::SetAllowPrecache( true ); @@ -7322,7 +7346,6 @@ void CC_Ent_Create( const CCommand& args ) DispatchSpawn(entity); // Now attempt to drop into the world - CBasePlayer* pPlayer = UTIL_GetCommandClient(); trace_t tr; Vector forward; pPlayer->EyeVectors( &forward ); -- cgit v1.2.3