Skip to content
Permalink
Browse files

Fix not being able to change default sv_gravity when low grav style i…

…s loaded
  • Loading branch information...
TotallyMehis committed Jul 12, 2019
1 parent 503e87c commit fba23f521a1a401d6f126013ea0d92335abe5236
Showing with 11 additions and 4 deletions.
  1. +11 −4 addons/sourcemod/scripting/influx_style_lowgrav.sp
@@ -49,10 +49,6 @@ public void OnPluginStart()
g_ConVar_GravMult.AddChangeHook( E_ConVarChanged_GravMult );


g_flDefaultGravity = 800.0;
g_flLowGravGravity = g_flDefaultGravity * g_ConVar_GravMult.FloatValue;


AutoExecConfig( true, "style_lowgrav", "influx" );


@@ -83,6 +79,17 @@ public void OnPluginEnd()
Influx_RemoveStyle( STYLE_LOWGRAV );
}

public void OnConfigsExecuted()
{
g_flDefaultGravity = g_ConVar_Gravity.FloatValue;
g_flLowGravGravity = g_flDefaultGravity * g_ConVar_GravMult.FloatValue;
}

public void OnClientPutInServer( int client )
{
Inf_SendConVarValueFloat( client, g_ConVar_Gravity, g_flDefaultGravity );
}

public void E_ConVarChanged_GravMult( ConVar convar, const char[] oldValue, const char[] newValue )
{
g_flLowGravGravity = g_flDefaultGravity * g_ConVar_GravMult.FloatValue;

0 comments on commit fba23f5

Please sign in to comment.
You can’t perform that action at this time.