diff options
| author | Narendra Umate <[email protected]> | 2013-12-08 01:27:41 -0800 |
|---|---|---|
| committer | Narendra Umate <[email protected]> | 2013-12-08 01:27:41 -0800 |
| commit | 4fa56874ba1557274c10077bf8386ece4c61dbd6 (patch) | |
| tree | e2d336604e960b548e996d2e7dcfc5a1e1401b9e /mp/src/game/server/triggers.cpp | |
| parent | Added DS_Store to .gitignore. (diff) | |
| parent | Make libSDL2.so/dylib into symlinks. (diff) | |
| download | source-sdk-2013-4fa56874ba1557274c10077bf8386ece4c61dbd6.tar.xz source-sdk-2013-4fa56874ba1557274c10077bf8386ece4c61dbd6.zip | |
Merge remote-tracking branch 'upstream/master'
Reverted .gitattributes xcode_ccache_wrapper change. Fixed line endings
for .gitignore and .gitattributes.
Diffstat (limited to 'mp/src/game/server/triggers.cpp')
| -rw-r--r-- | mp/src/game/server/triggers.cpp | 53 |
1 files changed, 34 insertions, 19 deletions
diff --git a/mp/src/game/server/triggers.cpp b/mp/src/game/server/triggers.cpp index 8835ab26..295e826a 100644 --- a/mp/src/game/server/triggers.cpp +++ b/mp/src/game/server/triggers.cpp @@ -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; |