1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-09-19 03:56:10 +08:00

SDK sync.

This commit is contained in:
Nicholas Hastings
2014-02-28 14:08:09 -05:00
parent 7cc1bd2f96
commit e2781a0000
558 changed files with 39082 additions and 1463 deletions

View File

@ -392,30 +392,37 @@ bool CBaseTrigger::PassesTriggerFilters(CBaseEntity *pOther)
bool bOtherIsPlayer = pOther->IsPlayer();
if ( HasSpawnFlags(SF_TRIGGER_ONLY_CLIENTS_IN_VEHICLES) && bOtherIsPlayer )
if ( bOtherIsPlayer )
{
if ( !((CBasePlayer*)pOther)->IsInAVehicle() )
CBasePlayer *pPlayer = (CBasePlayer*)pOther;
if ( !pPlayer->IsAlive() )
return false;
// Make sure we're also not exiting the vehicle at the moment
IServerVehicle *pVehicleServer = ((CBasePlayer*)pOther)->GetVehicle();
if ( pVehicleServer == NULL )
return false;
if ( pVehicleServer->IsPassengerExiting() )
return false;
}
if ( HasSpawnFlags(SF_TRIGGER_ONLY_CLIENTS_IN_VEHICLES) )
{
if ( !pPlayer->IsInAVehicle() )
return false;
if ( HasSpawnFlags(SF_TRIGGER_ONLY_CLIENTS_OUT_OF_VEHICLES) && bOtherIsPlayer )
{
if ( ((CBasePlayer*)pOther)->IsInAVehicle() )
return false;
}
// Make sure we're also not exiting the vehicle at the moment
IServerVehicle *pVehicleServer = pPlayer->GetVehicle();
if ( pVehicleServer == NULL )
return false;
if ( HasSpawnFlags( SF_TRIGGER_DISALLOW_BOTS ) && bOtherIsPlayer )
{
if ( ((CBasePlayer*)pOther)->IsFakeClient() )
return false;
if ( pVehicleServer->IsPassengerExiting() )
return false;
}
if ( HasSpawnFlags(SF_TRIGGER_ONLY_CLIENTS_OUT_OF_VEHICLES) )
{
if ( pPlayer->IsInAVehicle() )
return false;
}
if ( HasSpawnFlags( SF_TRIGGER_DISALLOW_BOTS ) )
{
if ( pPlayer->IsFakeClient() )
return false;
}
}
CBaseFilter *pFilter = m_hFilter.Get();
@ -503,6 +510,14 @@ void CBaseTrigger::EndTouch(CBaseEntity *pOther)
{
m_hTouchingEntities.Remove( i );
}
else if ( hOther->IsPlayer() && !hOther->IsAlive() )
{
#ifdef STAGING_ONLY
AssertMsg( 0, CFmtStr( "Dead player [%s] is still touching this trigger at [%f %f %f]", hOther->GetEntityName().ToCStr(), XYZ( hOther->GetAbsOrigin() ) ) );
Warning( "Dead player [%s] is still touching this trigger at [%f %f %f]", hOther->GetEntityName().ToCStr(), XYZ( hOther->GetAbsOrigin() ) );
#endif
m_hTouchingEntities.Remove( i );
}
else
{
bFoundOtherTouchee = true;