Skip to content

Commit

Permalink
Prevent double fires
Browse files Browse the repository at this point in the history
Co-authored-by: Valkyrie <[email protected]>
  • Loading branch information
TomyLobo and voxelizedworld committed Feb 15, 2021
1 parent c264c42 commit b15cbac
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 3 additions & 1 deletion mp/src/game/client/sdk/c_te_firebullets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ void C_TEFireBullets::PostDataUpdate( DataUpdateType_t updateType )
m_iWeaponID,
m_iMode,
m_iSeed,
m_flSpread );
m_flSpread,
false
);
}


Expand Down
6 changes: 4 additions & 2 deletions mp/src/game/shared/sdk/sdk_fx_shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ void FX_FireBullets(
int iWeaponID,
int iMode,
int iSeed,
float flSpread
float flSpread,
bool bShouldPlaySound
)
{
Assert(vOrigin.IsValid());
Expand Down Expand Up @@ -188,7 +189,8 @@ void FX_FireBullets(
//ProjectedLightEffectManager( iPlayerIndex ).TriggerMuzzleFlash();
#endif

FX_WeaponSound( iPlayerIndex, sound_type, vOrigin, pWeaponInfo );
if (bShouldPlaySound)
FX_WeaponSound(iPlayerIndex, sound_type, vOrigin, pWeaponInfo);
}


Expand Down
3 changes: 2 additions & 1 deletion mp/src/game/shared/sdk/sdk_fx_shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ void FX_FireBullets(
int iWeaponID,
int iMode,
int iSeed,
float flSpread
float flSpread,
bool bShouldPlaySound
);


Expand Down
3 changes: 2 additions & 1 deletion mp/src/game/shared/sdk/weapon_sdkbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,8 @@ void CWeaponSDKBase::FinishAttack (CSDKPlayer *pPlayer)
GetWeaponID(),
0, //Tony; fire mode - this is unused at the moment, left over from CSS when SDK* was created in the first place.
CBaseEntity::GetPredictionRandomSeed() & 255,
flSpread
flSpread,
true
);

//Add our view kick in
Expand Down

0 comments on commit b15cbac

Please sign in to comment.