I just did a little something with hl2mp, to make the third person
muzzleflashes reliable for the local player who is in third person.

Open up
c_baseanimating.cpp

inside C_BaseAnimating::FireEvent
Here are my changes.

        case AE_MUZZLEFLASH:
                {
                        // Send out the effect for a player
#if defined ( HL2MP )
                        // HL2MP - Make third person muzzleflashes as
reliable as the first person ones
                        // while in third person the view model
dispatches the muzzleflash event - note: the weapon models dispatch them
too, but not frequently.
                        if ( IsViewModel() )
                        {
                                C_BasePlayer *pPlayer = ToBasePlayer(
dynamic_cast<C_BaseViewModel *>(this)->GetOwner() );
                                if ( pPlayer && pPlayer ==
C_BasePlayer::GetLocalPlayer())
                                {
                                        if (
::input->CAM_IsThirdPerson() )
                                        {
                                                // Dispatch on the
weapon - the player model doesn't have the attachments in hl2mp.
                                                C_BaseCombatWeapon
*pWeapon = pPlayer->GetActiveWeapon();
                                                if ( !pWeapon )
                                                        break;
        
pWeapon->DispatchMuzzleEffect( options, false );
                                                break;
                                        }
                                }
                        }
#endif
                        DispatchMuzzleEffect( options, true );
                        break;
                }


-Tony
 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jorge
Rodriguez
Sent: October-06-08 12:44 PM
To: Discussion of Half-Life Programming
Subject: Re: [hlcoders] Muzzle flash issue

I believe the view model uses an animation event instead of being
triggered
by code.


-- 
Jorge "Vino" Rodriguez
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders


_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to