aboutsummaryrefslogtreecommitdiff
path: root/mp/src/game/server/util.cpp
diff options
context:
space:
mode:
authorJohn Schoenick <[email protected]>2015-09-09 18:35:41 -0700
committerJohn Schoenick <[email protected]>2015-09-09 18:35:41 -0700
commit0d8dceea4310fde5706b3ce1c70609d72a38efdf (patch)
treec831ef32c2c801a5c5a80401736b52c7b5a528ec /mp/src/game/server/util.cpp
parentUpdated the SDK with the latest code from the TF and HL2 branches. (diff)
downloadsource-sdk-2013-0d8dceea4310fde5706b3ce1c70609d72a38efdf.tar.xz
source-sdk-2013-0d8dceea4310fde5706b3ce1c70609d72a38efdf.zip
Updated the SDK with the latest code from the TF and HL2 branches.HEADmaster
Diffstat (limited to 'mp/src/game/server/util.cpp')
-rw-r--r--mp/src/game/server/util.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/mp/src/game/server/util.cpp b/mp/src/game/server/util.cpp
index 8cd8f989..4b2008df 100644
--- a/mp/src/game/server/util.cpp
+++ b/mp/src/game/server/util.cpp
@@ -59,7 +59,7 @@ void DBG_AssertFunction( bool fExpr, const char *szExpr, const char *szFile, int
Q_snprintf(szOut,sizeof(szOut), "ASSERT FAILED:\n %s \n(%s@%d)\n%s", szExpr, szFile, szLine, szMessage);
else
Q_snprintf(szOut,sizeof(szOut), "ASSERT FAILED:\n %s \n(%s@%d)\n", szExpr, szFile, szLine);
- Warning( szOut);
+ Warning( "%s", szOut);
}
#endif // DEBUG
@@ -161,6 +161,11 @@ IServerNetworkable *CEntityFactoryDictionary::Create( const char *pClassName )
IEntityFactory *pFactory = FindFactory( pClassName );
if ( !pFactory )
{
+#ifdef STAGING_ONLY
+ static ConVarRef tf_bot_use_items( "tf_bot_use_items" );
+ if ( tf_bot_use_items.IsValid() && tf_bot_use_items.GetInt() )
+ return NULL;
+#endif
Warning("Attempted to create unknown entity type %s!\n", pClassName );
return NULL;
}
@@ -568,6 +573,24 @@ CBasePlayer *UTIL_PlayerByIndex( int playerIndex )
return pPlayer;
}
+CBasePlayer *UTIL_PlayerBySteamID( const CSteamID &steamID )
+{
+ CSteamID steamIDPlayer;
+ for ( int i = 1; i <= gpGlobals->maxClients; i++ )
+ {
+ CBasePlayer *pPlayer = UTIL_PlayerByIndex( i );
+ if ( !pPlayer )
+ continue;
+
+ if ( !pPlayer->GetSteamID( &steamIDPlayer ) )
+ continue;
+
+ if ( steamIDPlayer == steamID )
+ return pPlayer;
+ }
+ return NULL;
+}
+
CBasePlayer* UTIL_PlayerByName( const char *name )
{
if ( !name || !name[0] )