mastercomfig / tf2-patches

Team Fortress 2, but with a lot of fixes, QoL improvements and performance optimizations!
Other
218 stars 27 forks source link

Jarate/Mad Milk reskin projectiles behave like stock under certain circumstances #231

Open Margen67 opened 4 years ago

Margen67 commented 4 years ago

Description

https://wiki.teamfortress.com/wiki/Self-Aware_Beauty_Mark#Bugs https://wiki.teamfortress.com/wiki/Mutated_Milk#Bugs Projectiles from the Self-Aware Beauty Mark, Festive Jarate, Mutated Milk, etc use the wrong model if you throw the projectile, and quickly switch to another weapon.

Potentially responsible code: https://github.com/mastercomfig/team-comtress-2/blob/master/game/shared/tf/tf_weapon_jar.cpp#L266-#L289

void CTFProjectile_Jar::SetCustomPipebombModel()
{
    // Check for Model Override
    int iProjectile = 0;
    CTFPlayer *pThrower = ToTFPlayer( GetThrower() );
    if ( pThrower && pThrower->GetActiveWeapon() )
    {
        CALL_ATTRIB_HOOK_INT_ON_OTHER( pThrower->GetActiveWeapon(), iProjectile, override_projectile_type );
        switch ( iProjectile )
        {
        case TF_PROJECTILE_FESTIVE_JAR :
            m_iProjectileType = iProjectile;
            SetModel( TF_WEAPON_FESTIVE_PEEJAR_MODEL );
            return;
        case TF_PROJECTILE_BREADMONSTER_JARATE:
        case TF_PROJECTILE_BREADMONSTER_MADMILK:
            m_iProjectileType = iProjectile;
            SetModel( "models/weapons/c_models/c_breadmonster/c_breadmonster.mdl" );
            return;
        }
    }

    SetModel( TF_WEAPON_PEEJAR_MODEL );
}

Checklist

Reproduction

  1. Throw weapon
  2. Switch to another weapon quickly
  3. The projectile should have the model that the reskin is based off of (e.g. Jarate/Mad Milk)

Screenshots

Setup Details

Performance Details

Margen67 commented 4 years ago

Another note: If you throw a projectile close enough to an enemy, it can cause it to behave like stock (no breadmonster on head)