nosoop / SM-TFCustomAttributeStarterPack

A collection of plugins to be used with the TF2 Custom Attribute framework.
MIT License
20 stars 10 forks source link

Remove the slow from heavy's rage #47

Closed tsuza closed 3 years ago

tsuza commented 3 years ago

Remove the slow from heavy's rage

During heavy's rage, players that get hit get slowed for 0.25 seconds by 100%. They can't move. This patches over that part so it doesn't happen. I wrote a standalone plugin to do this for my server, but decided to port it to generate_rage_on_dmg_patch.sp since it makes more sense.

Gamedata

The windows gamedata is correct. The Linux one should be too, but it's untested.

Details

This is part of the code in CTFWeaponBase::ApplyOnHitAttributes() that causes it.

int iRageStun = 0;
CALL_ATTRIB_HOOK_INT_ON_OTHER( pAttacker, iRageStun, generate_rage_on_dmg );
if ( iRageStun && pAttacker->m_Shared.IsRageDraining() )
{
    // MvM: Heavies can purchase a rage-based knockback+stun effect
    if ( pAttacker->IsPlayerClass( TF_CLASS_HEAVYWEAPONS ) )
    {
        int iStunFlags = TF_STUN_MOVEMENT | TF_STUN_NO_EFFECTS;
        pVictim->m_Shared.StunPlayer( 0.25f, 1.f, iStunFlags, pAttacker );
    }
}
nosoop commented 3 years ago

Looks good to me; thanks!