diff options
Diffstat (limited to 'mp/src/game/server/baseentity.cpp')
| -rw-r--r-- | mp/src/game/server/baseentity.cpp | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/mp/src/game/server/baseentity.cpp b/mp/src/game/server/baseentity.cpp index b42f2abe..7a7a7e6c 100644 --- a/mp/src/game/server/baseentity.cpp +++ b/mp/src/game/server/baseentity.cpp @@ -344,6 +344,8 @@ void CBaseEntityModelLoadProxy::Handler::OnModelLoadComplete( const model_t *pMo CBaseEntity::CBaseEntity( bool bServerOnly ) { + m_pAttributes = NULL; + COMPILE_TIME_ASSERT( MOVETYPE_LAST < (1 << MOVETYPE_MAX_BITS) ); COMPILE_TIME_ASSERT( MOVECOLLIDE_COUNT < (1 << MOVECOLLIDE_MAX_BITS) ); @@ -4822,7 +4824,7 @@ void CBaseEntity::PrecacheModelComponents( int nModelIndex ) char token[256]; const char *pOptions = pEvent->pszOptions(); nexttoken( token, pOptions, ' ' ); - if ( token ) + if ( token[0] ) { PrecacheParticleSystem( token ); } @@ -4908,7 +4910,9 @@ int CBaseEntity::PrecacheModel( const char *name, bool bPreload ) { if ( !name || !*name ) { +#ifdef STAGING_ONLY Msg( "Attempting to precache model, but model name is NULL\n"); +#endif return -1; } @@ -4917,8 +4921,7 @@ int CBaseEntity::PrecacheModel( const char *name, bool bPreload ) { if ( !engine->IsModelPrecached( name ) ) { - Assert( !"CBaseEntity::PrecacheModel: too late" ); - Warning( "Late precache of %s\n", name ); + DevMsg( "Late precache of %s -- not necessarily a bug now that we allow ~everything to be dynamically loaded.\n", name ); } } #if defined( WATCHACCESS ) @@ -5316,11 +5319,6 @@ void CC_Ent_FireTarget( const CCommand& args ) } static ConCommand firetarget("firetarget", CC_Ent_FireTarget, 0, FCVAR_CHEAT); -static bool UtlStringLessFunc( const CUtlString &lhs, const CUtlString &rhs ) -{ - return Q_stricmp( lhs.String(), rhs.String() ) < 0; -} - class CEntFireAutoCompletionFunctor : public ICommandCallback, public ICommandCompletionCallback { public: @@ -6656,23 +6654,19 @@ void CBaseEntity::DispatchResponse( const char *conceptName ) AI_Response result; bool found = rs->FindBestResponse( set, result ); if ( !found ) - { return; - } // Handle the response here... - char response[ 256 ]; - result.GetResponse( response, sizeof( response ) ); + const char *szResponse = result.GetResponsePtr(); switch ( result.GetType() ) { case RESPONSE_SPEAK: - { - EmitSound( response ); - } + EmitSound( szResponse ); break; + case RESPONSE_SENTENCE: { - int sentenceIndex = SENTENCEG_Lookup( response ); + int sentenceIndex = SENTENCEG_Lookup( szResponse ); if( sentenceIndex == -1 ) { // sentence not found @@ -6684,16 +6678,13 @@ void CBaseEntity::DispatchResponse( const char *conceptName ) CBaseEntity::EmitSentenceByIndex( filter, entindex(), CHAN_VOICE, sentenceIndex, 1, result.GetSoundLevel(), 0, PITCH_NORM ); } break; + case RESPONSE_SCENE: - { - // Try to fire scene w/o an actor - InstancedScriptedScene( NULL, response ); - } + // Try to fire scene w/o an actor + InstancedScriptedScene( NULL, szResponse ); break; - case RESPONSE_PRINT: - { - } + case RESPONSE_PRINT: break; default: // Don't know how to handle .vcds!!! @@ -7051,7 +7042,7 @@ void CBaseEntity::SetRefEHandle( const CBaseHandle &handle ) if ( edict() ) { COMPILE_TIME_ASSERT( NUM_NETWORKED_EHANDLE_SERIAL_NUMBER_BITS <= 8*sizeof( edict()->m_NetworkSerialNumber ) ); - edict()->m_NetworkSerialNumber = (m_RefEHandle.GetSerialNumber() & (1 << NUM_NETWORKED_EHANDLE_SERIAL_NUMBER_BITS) - 1); + edict()->m_NetworkSerialNumber = m_RefEHandle.GetSerialNumber() & ( (1 << NUM_NETWORKED_EHANDLE_SERIAL_NUMBER_BITS) - 1 ); } } |