Skip to content

Commit

Permalink
Fix some things
Browse files Browse the repository at this point in the history
  • Loading branch information
ScriptedSnark committed Apr 9, 2024
1 parent c580bef commit af71a47
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions GSChaos/CChaos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,11 @@ double CChaos::GetTime()
return m_flTime;
}

double CChaos::GetChaosTime()
{
return m_flChaosTime;
}

double CChaos::GetGlobalTime()
{
return m_flGlobalTime;
Expand Down
1 change: 1 addition & 0 deletions GSChaos/CChaos.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class CChaos
int GetRandomEffect(int min, int max);
float GetRandomValue(float min, float max);
double GetTime();
double GetChaosTime();
double GetGlobalTime();
int GetFrameCount();
bool IsReady();
Expand Down
6 changes: 3 additions & 3 deletions GSChaos/CFeatureLobotomy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ void CFeatureLobotomy::DoMegaLobotomy(double time)

EMIT_SOUND_DYN2((*sv_player), CHAN_ITEM, "fvox/beep.wav", 1.0, ATTN_IDLE, 0, gChaos.GetRandomValue(PITCH_LOW - 20, PITCH_HIGH + 20));

m_flLobotomyTPTime = gChaos.GetGlobalTime() + (((CHAOS_ACTIVATE_TIMER / 2.0) / time) / 2.0); // :skull:
m_flLobotomyTPTime = gChaos.GetGlobalTime() + (((gChaos.GetChaosTime() / 2.0) / time) / 2.0); // :skull:
}

void CFeatureLobotomy::OnFrame(double time)
{
if (!m_bActivated)
return;

if (time > (CHAOS_ACTIVATE_TIMER - 10.0f))
if (time > (gChaos.GetChaosTime() - 10.0f))
{
if (!m_bPlayedSound)
{
Expand Down Expand Up @@ -102,7 +102,7 @@ void CFeatureLobotomy::OnFrame(double time)

EMIT_SOUND_DYN2((*sv_player), CHAN_ITEM, "fvox/beep.wav", 1.0, ATTN_IDLE, 0, gChaos.GetRandomValue(PITCH_LOW - 20, PITCH_HIGH + 20));

if (time > (CHAOS_ACTIVATE_TIMER - 10.0f))
if (time > (gChaos.GetChaosTime() - 10.0f))
m_flLobotomyTPTime = gChaos.GetGlobalTime() + 0.5;
else
m_flLobotomyTPTime = gChaos.GetGlobalTime() + (LOBOTOMY_TP_TIME / 4.0);
Expand Down
2 changes: 1 addition & 1 deletion GSChaos/CFeatureSwapHealth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ void CFeatureSwapHealth::ActivateFeature()
armor = (*sv_player)->v.armorvalue;

(*sv_player)->v.health = max(1.0f, armor);
(*sv_player)->v.armorvalue = health;
(*sv_player)->v.armorvalue = min(health, 4000.0f); // 5000-5100 is crash point - StereoBucket
}

void CFeatureSwapHealth::DeactivateFeature()
Expand Down

0 comments on commit af71a47

Please sign in to comment.