mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-02-05 02:00:34 +03:00
Fix CBaseEntity::CanBeHitByMeleeAttack() not blocking damage from CTraceFilterMelee
This commit is contained in:
parent
0e110b7823
commit
c6ee15336f
@ -1264,6 +1264,11 @@ bool CTraceFilterMelee::ShouldHitEntity( IHandleEntity *pHandleEntity, int conte
|
|||||||
if ( pEntity->m_takedamage == DAMAGE_NO )
|
if ( pEntity->m_takedamage == DAMAGE_NO )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
#ifdef MAPBASE // Moved from CheckTraceHullAttack()
|
||||||
|
if( m_pPassEnt && !pEntity->CanBeHitByMeleeAttack( const_cast<CBaseEntity*>(EntityFromEntityHandle( m_pPassEnt ) ) ) )
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
|
||||||
// FIXME: Do not translate this to the driver because the driver only accepts damage from the vehicle
|
// FIXME: Do not translate this to the driver because the driver only accepts damage from the vehicle
|
||||||
// Translate the vehicle into its driver for damage
|
// Translate the vehicle into its driver for damage
|
||||||
/*
|
/*
|
||||||
@ -1311,6 +1316,10 @@ bool CTraceFilterMelee::ShouldHitEntity( IHandleEntity *pHandleEntity, int conte
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#ifdef MAPBASE
|
||||||
|
// Do not override an existing hit entity
|
||||||
|
if (!m_pHit)
|
||||||
|
#endif
|
||||||
m_pHit = pEntity;
|
m_pHit = pEntity;
|
||||||
|
|
||||||
// Make sure if the player is holding this, he drops it
|
// Make sure if the player is holding this, he drops it
|
||||||
@ -1386,11 +1395,13 @@ CBaseEntity *CBaseCombatCharacter::CheckTraceHullAttack( const Vector &vStart, c
|
|||||||
pEntity = traceFilter.m_pHit;
|
pEntity = traceFilter.m_pHit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef MAPBASE // Moved to CTraceFilterMelee
|
||||||
if( pEntity && !pEntity->CanBeHitByMeleeAttack(this) )
|
if( pEntity && !pEntity->CanBeHitByMeleeAttack(this) )
|
||||||
{
|
{
|
||||||
// If we touched something, but it shouldn't be hit, return nothing.
|
// If we touched something, but it shouldn't be hit, return nothing.
|
||||||
pEntity = NULL;
|
pEntity = NULL;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return pEntity;
|
return pEntity;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user