Skip to content

Commit

Permalink
Air accel
Browse files Browse the repository at this point in the history
  • Loading branch information
haxtonsale committed Jul 19, 2019
1 parent 1a3dea1 commit 56470ab
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
1 change: 1 addition & 0 deletions configs/instagib.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"AutoBhop" "1"
"BhopMaxSpeed" "456.0"
"MultikillInterval" "3"
"AirAcceleration" "15"
}

"Rounds"
Expand Down
19 changes: 11 additions & 8 deletions scripting/instagib.sp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// -------------------------------------------------------------------
#define INSTAGIB_VERSION "1.4.3"
#define INSTAGIB_VERSION "1.4.4"

//#define DEBUG

Expand Down Expand Up @@ -142,6 +142,7 @@ int g_GamerulesEnt;

Handle g_Weapon_Railgun;
Handle g_RoundTimer;
ConVar g_CvarAirAccel;

Config g_Config;
bool g_MusicEnabled = true;
Expand Down Expand Up @@ -546,9 +547,16 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max

public void OnPluginStart()
{
CreateTimer(1.0, Timer_MultikillTick, _, TIMER_REPEAT);
g_CvarAirAccel = FindConVar("sv_airaccelerate");

LoadConfig();
Cookies_Init();
Commands_Init();
CreateDefaultRailgun();
Events_Init();
Rounds_Init();
Hud_Init();

if (IsLateLoad) {
for (int i = 1; i <= MaxClients; i++) {
Expand All @@ -569,13 +577,6 @@ public void OnPluginStart()
InstagibPrintToChatAll(true, "Late Load! Restarting the round...");
Stalemate();
}

CreateDefaultRailgun();
Events_Init();
Rounds_Init();
Hud_Init();

CreateTimer(1.0, Timer_MultikillTick, _, TIMER_REPEAT);
}

public void OnMapStart()
Expand Down Expand Up @@ -717,6 +718,8 @@ public void OnPluginEnd()

GameRules_SetProp("m_nHudType", 0);
GameRules_SetProp("m_bPlayingRobotDestructionMode", false);

g_CvarAirAccel.RestoreDefault();
}

public void OnLibraryAdded(const char[] name)
Expand Down
2 changes: 2 additions & 0 deletions scripting/instagib/config.sp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ void LoadConfig()
g_Config.BhopMaxSpeed = IGConfig.GetFloat("BhopMaxSpeed", 456.0);
g_Config.MultikillInterval = IGConfig.GetNum("MultikillInterval", 3);

g_CvarAirAccel.SetInt(IGConfig.GetNum("AirAcceleration", 30));

IGConfig.Rewind();
IGConfig.JumpToKey("Music");

Expand Down

0 comments on commit 56470ab

Please sign in to comment.