Also note that in debug, you will get an assert with the RPG because the
rpg world model's attachment isn't "muzzle" like the other weapons with
attachments, and it won't do a muzzle flash for it, but you could fix
that up by checking if the weapon is the rpg, and change the options to
use the correct attachment name.

This is a start anyway.


-Tony
 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Tony Sergi
Sent: October-06-08 1:30 PM
To: Discussion of Half-Life Programming
Subject: Re: [hlcoders] Muzzle flash issue

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
 

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

Reply via email to