AURA energy regeneration feature should take into account player might be in Observer or Dead... #117
Labels
Bug
Something isn't working
Feature Request
New feature or request
Fix Proposed
Good First Issue
Good for newcomers
Milestone
I was looking ta the code for the energy regeneration you have in Aura and I noticed few flaws...
I will suggest the solutions to those here:
For 1: the solution is quite simple, increase the time for regen to say 0.5 / 0.3 secs.
For 2: Add a client CVAR to disable the sound or tone the sounds down more...
For 3: You should add some checks and few additional stops for the sounds.
Let's start with the checks:
right after the statements:
if (pev->armorvalue <= 0)
,if (pev->armorvalue < 10)
andif (sv_aura_regeneration.value != 0 && pev->armorvalue < MAX_NORMAL_BATTERY && m_flNextSuitRegenTime < gpGlobals->time)
add this:
The we need to add the stop for the sounds if we die or we get to Spectator/Observer:
In the functions:
void CBasePlayer::StartObserver( Vector vecPosition, Vector vecViewAngle )
andvoid CBasePlayer::Killed( entvars_t *pevAttacker, int iGib )
add this:
And this should fix the issues... IF you have other functions like welcome camera etc you'll have to take that one into account as well.
More clean way would be to create a function to stop those sounds and to call it instead, but it's up to use to decide.
The text was updated successfully, but these errors were encountered: