mirror of
https://github.com/ValveSoftware/source-sdk-2013.git
synced 2025-04-09 03:24:52 +00:00
Make flame damage direction independent against tanks
This commit is contained in:
parent
aea94b32cb
commit
cdebcd083c
2 changed files with 42 additions and 0 deletions
|
@ -457,6 +457,47 @@ bool CTFFlameManager::AddPoint( int iCurrentTick )
|
|||
return bRet;
|
||||
}
|
||||
|
||||
void CTFFlameManager::Touch( CBaseEntity* pOther )
|
||||
{
|
||||
if ( !ShouldCollide( pOther ) )
|
||||
return;
|
||||
|
||||
// find the first point that collide with this ent
|
||||
FOR_EACH_VEC( GetPointVec(), i)
|
||||
{
|
||||
int iPoint = i;
|
||||
|
||||
// As Pyro to maximise damage it is beneficial to not have old flame particles
|
||||
// touch the target. This is relevant when attacking tanks, and looking sideways
|
||||
// or upwards minimises the time flame particles touch tanks -> less lifetime
|
||||
// penalty for the oldest touching.
|
||||
// As a fix, loop backwards and always take the newest particle
|
||||
if ( TFGameRules() && TFGameRules()->IsMannVsMachineMode() && !Q_strcmp( pOther->m_iClassname.ToCStr(), "tank_boss" ) )
|
||||
{
|
||||
iPoint = GetPointVec().Count() - i - 1;
|
||||
}
|
||||
|
||||
tf_point_t* pPoint = GetPointVec()[iPoint];
|
||||
|
||||
float flRadius = GetRadius( pPoint );
|
||||
Vector vMins = flRadius * Vector( -1, -1, -1 );
|
||||
Vector vMaxs = flRadius * Vector( 1, 1, 1 );
|
||||
|
||||
Ray_t ray;
|
||||
ray.Init( pPoint->m_vecPrevPosition, pPoint->m_vecPosition, vMins, vMaxs );
|
||||
|
||||
trace_t trEnt;
|
||||
enginetrace->ClipRayToEntity( ray, MASK_SOLID | CONTENTS_HITBOX, pOther, &trEnt );
|
||||
if ( trEnt.DidHit() )
|
||||
{
|
||||
OnCollide( pOther, iPoint );
|
||||
|
||||
// found the first ray that hit this entity, stop checking against other rays
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CTFFlameManager::HookAttributes()
|
||||
{
|
||||
|
|
|
@ -68,6 +68,7 @@ public:
|
|||
|
||||
static CTFFlameManager* Create( CBaseEntity *pOwner, bool bIsAdditionalManager = false );
|
||||
virtual bool AddPoint( int iCurrentTick ) OVERRIDE;
|
||||
virtual void Touch( CBaseEntity* pOther ) OVERRIDE;
|
||||
void HookAttributes();
|
||||
void UpdateDamage( int iDmgType, float flDamage, float flBurnFrequency, bool bCritFromBehind );
|
||||
bool BCanBurnEntityThisFrame( CBaseEntity *pEnt ) const;
|
||||
|
|
Loading…
Reference in a new issue