aboutsummaryrefslogtreecommitdiff
path: root/sp/src/game/server/triggers.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sp/src/game/server/triggers.cpp')
-rw-r--r--sp/src/game/server/triggers.cpp53
1 files changed, 34 insertions, 19 deletions
diff --git a/sp/src/game/server/triggers.cpp b/sp/src/game/server/triggers.cpp
index 8835ab26..295e826a 100644
--- a/sp/src/game/server/triggers.cpp
+++ b/sp/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;