diff options
Diffstat (limited to 'mp/src/game/server/util.cpp')
| -rw-r--r-- | mp/src/game/server/util.cpp | 25 |
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] ) |