CGAME: fix for PW_REGEN powerup prediction (playing pain sounds). #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
BUG: sometimes the player's pain sound is played when the player's health increases (e.g.: holding the Regeneration powerup).
In this case every second the powerup increases the health of a player a pain sound is played additionally to the powerup regeneration sound. A while ago I talked about this issue here: https://github.com/ec-/Quake3e/issues/18
Anyways, this issue is really hard to reproduce because it only happens very rare.
BUGFIX: I have been playing around with the code for over a year and have never figured out what is causing the problem, nor have I found a solution.
Well, now I found out that changing how cg.timeResidual is set seems to fix the issue.
To be honest I don't understand why this will fix the issue. I simply borrowed the code from 'ClientTimerActions' (in g_active.c).
NOTE: I played many matches using this 'bugfix' and it seem to work well. If you want apply the PR I highly recommend to check the changes twice, because I don't really understand the code, and potential consequences.