Skip to content

Conversation

@k-vog
Copy link
Owner

@k-vog k-vog commented Oct 25, 2025

There are three different ways CTFPlayerShared::OnAddSodaPopperHype can be called:
1: ItemPostFrame() calls SecondaryAttack(), which adds the cond
2: ItemBusyFrame() calls SecondaryAttack(), which adds the cond
3: The server adds the condition manually

We really only want the sound to play in cases 1 and 2. Guarding against case 3 is easy since m_bSyncingConditions will be true.

The current issue is that ItemPostFrame() and ItemBusyFrame() are called during client prediction. Normally you can just check IsFirstTimePredicted(), but for some reason, this is always false when the function is called from ItemBusyFrame(). Worse yet, m_bSyncingConditions is true in that case.

At this point, the sound will never fire twice, but it will get skipped when this function is called from ItemBusyFrame() (when the player activates hype while their scattergun is reloading)

Description

There are three different ways CTFPlayerShared::OnAddSodaPopperHype can
be called:
  1: ItemPostFrame() calls SecondaryAttack(), which adds the cond
  2: ItemBusyFrame() calls SecondaryAttack(), which adds the cond
  3: The server adds the condition manually

We really only want the sound to play in cases 1 and 2. Guarding against
case 3 is easy since m_bSyncingConditions will be true.

The current issue is that ItemPostFrame() and ItemBusyFrame() are called
during client prediction. Normally you can just check
IsFirstTimePredicted(), but for some reason, this is always false when
the function is called from ItemBusyFrame(). Worse yet,
m_bSyncingConditions is true in that case.

At this point, the sound will never fire twice, but it will get skipped
when this function is called from ItemBusyFrame() (when the player
activates hype while their scattergun is reloading)
{
#ifdef CLIENT_DLL

#if 0
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#if 0
#if 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants