Wazanator

Fix for HL2MP 2013 muzzleflash

Aug 31st, 2013
510
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.85 KB | None | 0 0
  1. //-----------------------------------------------------------------------------
  2. // Purpose: Play muzzle flash
  3. // Input  : *pos1 -
  4. //          type -
  5. //-----------------------------------------------------------------------------
  6. void CTempEnts::MuzzleFlash( const Vector& pos1, const QAngle& angles, int type, ClientEntityHandle_t hEntity, bool firstPerson )
  7. {
  8. #ifdef CSTRIKE_DLL
  9.  
  10.     return;
  11.  
  12. #else
  13.  
  14.     //NOTENOTE: This function is becoming obsolete as the muzzles are moved over to being local to attachments
  15.  
  16.     switch ( type )
  17.     {
  18.     //
  19.     // Shotgun
  20.     //
  21.     case MUZZLEFLASH_SHOTGUN:
  22.         if ( firstPerson )
  23.         {
  24.             MuzzleFlash_Shotgun_Player( hEntity, 1 );
  25.         }
  26.         else
  27.         {
  28.             MuzzleFlash_Shotgun_NPC( hEntity, 1 );
  29.         }
  30.         break;
  31.  
  32.     // UNDONE: These need their own effects/sprites.  For now use the pistol
  33.     // SMG1
  34. #if defined ( HL2MP )       //  HACK for hl2mp, make the default muzzleflash the smg muzzleflash for weapons like the RPG that are using 'type 0'
  35.     default:
  36. #endif // HL2MP
  37.     case MUZZLEFLASH_SMG1:
  38.         if ( firstPerson )
  39.         {
  40.             MuzzleFlash_SMG1_Player( hEntity, 1 );
  41.         }
  42.         else
  43.         {
  44.             MuzzleFlash_SMG1_NPC( hEntity, 1 );
  45.         }
  46.         break;
  47.  
  48.     // SMG2
  49.     case MUZZLEFLASH_SMG2:
  50.     case MUZZLEFLASH_PISTOL:
  51.         if ( firstPerson )
  52.         {
  53.             MuzzleFlash_Pistol_Player( hEntity, 1 );
  54.         }
  55.         else
  56.         {
  57.             MuzzleFlash_Pistol_NPC( hEntity, 1 );
  58.         }
  59.         break;
  60.  
  61.     case MUZZLEFLASH_COMBINE:
  62.         if ( firstPerson )
  63.         {
  64.             //FIXME: These should go away
  65.             MuzzleFlash_Combine_Player( hEntity, 1 );
  66.         }
  67.         else
  68.         {
  69.             //FIXME: These should go away
  70.             MuzzleFlash_Combine_NPC( hEntity, 1 );
  71.         }
  72.         break;
  73. #if !defined ( HL2MP )  //  HACK for hl2mp, make the default muzzleflash the smg muzzleflash for weapons like the RPG that are using 'type 0'
  74.     default:
  75.         // There's no supported muzzle flash for the type specified!
  76.         Assert(0);
  77.         break;
  78. #endif // HL2MP
  79.     }
  80.  
  81. #endif
  82.  
  83. }
Advertisement
Add Comment
Please, Sign In to add comment