Open N7P0L3ON opened 3 hours ago
Hello @N7P0L3ON, thanks for the suggestions and for proposing a fix.
m_flNextSuitRegenTime = gpGlobals->time + 5.5 + sv_aura_regeneration_wait.value;
cl_music_enabled
has already been implemented, cl_aura_regeneration_sound_enabled
or something like that won't be too hard to implement so thanks for the suggestion.Sabian
Maybe you can make it to count the time out of combat and after that to start regenerating; not to regenerate during combat.
instead of adding the if statements to each other one, I decided to nest the entire suit energy regeneration code in a single if else statement. I haven't been able to test this in-depth with more than one player but it should work okay, if there's any problems I'll do your proposed method.
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.