1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-09-19 12:06:07 +08:00

Sync with latest source-sdk-2013.

This commit is contained in:
Nicholas Hastings
2014-10-30 12:30:57 -04:00
parent 6abc7fddca
commit aa5841f220
407 changed files with 6784 additions and 10498 deletions

View File

@ -303,7 +303,7 @@ IMPLEMENT_SERVERCLASS_ST_NOBASE( CBaseEntity, DT_BaseEntity )
SendPropBool( SENDINFO( m_bAlternateSorting )),
#ifdef TF_DLL
SendPropArray3( SENDINFO_ARRAY3(m_nModelIndexOverrides), SendPropInt( SENDINFO_ARRAY(m_nModelIndexOverrides), SP_MODEL_INDEX_BITS, SPROP_UNSIGNED ) ),
SendPropArray3( SENDINFO_ARRAY3(m_nModelIndexOverrides), SendPropInt( SENDINFO_ARRAY(m_nModelIndexOverrides), SP_MODEL_INDEX_BITS, 0 ) ),
#endif
END_SEND_TABLE()
@ -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 );
}
break;
case RESPONSE_PRINT:
{
}
case RESPONSE_SCENE:
// Try to fire scene w/o an actor
InstancedScriptedScene( NULL, szResponse );
break;
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 );
}
}