|
35 | 35 | #define TF_MINIGUN_SPINUP_TIME 0.75f |
36 | 36 | #define TF_MINIGUN_PENALTY_PERIOD 1.f |
37 | 37 |
|
| 38 | +#ifdef CLIENT_DLL |
| 39 | +extern ConVar cl_muzzleflash_dlight_1st; |
| 40 | +#endif |
| 41 | + |
38 | 42 | //============================================================================= |
39 | 43 | // |
40 | 44 | // Weapon Minigun tables. |
@@ -365,6 +369,32 @@ void CTFMinigun::SharedAttack() |
365 | 369 | // NVNT the local player fired a shot. notify the haptics system. |
366 | 370 | if ( haptics ) |
367 | 371 | haptics->ProcessHapticEvent(2,"Weapons","minigun_fire"); |
| 372 | + |
| 373 | + |
| 374 | + if ( cl_muzzleflash_dlight_1st.GetBool() == true && IsFirstPersonView() ) |
| 375 | + { |
| 376 | + Vector vecOrigin; |
| 377 | + QAngle angAngles; |
| 378 | + void TE_DynamicLight( IRecipientFilter& filter, float delay, |
| 379 | + const Vector* org, int r, int g, int b, int exponent, float radius, float time, float decay, int nLightIndex = LIGHT_INDEX_TE_DYNAMIC ); |
| 380 | + |
| 381 | + m_hMuzzleEffectWeapon = GetWeaponForEffect(); |
| 382 | + |
| 383 | + // Try and setup the attachment point if it doesn't already exist. |
| 384 | + // This caching will mess up if we go third person from first - we only do this in taunts and don't fire so we should |
| 385 | + // be okay for now. |
| 386 | + if ( m_iMuzzleAttachment <= 0 ) |
| 387 | + { |
| 388 | + m_iMuzzleAttachment = m_hMuzzleEffectWeapon->LookupAttachment( "muzzle" ); |
| 389 | + } |
| 390 | + m_hMuzzleEffectWeapon->GetAttachment( m_iMuzzleAttachment, vecOrigin, angAngles ); |
| 391 | + |
| 392 | + if ( m_iMuzzleAttachment > 0 ) |
| 393 | + { |
| 394 | + CLocalPlayerFilter filter; |
| 395 | + TE_DynamicLight( filter, 0.0f, &vecOrigin, 255, 192, 64, 5, 70.0f, 0.2f, 70.0f / 0.2f, LIGHT_INDEX_MUZZLEFLASH ); |
| 396 | + } |
| 397 | + } |
368 | 398 | } |
369 | 399 | #endif |
370 | 400 | CalcIsAttackCritical(); |
|
0 commit comments