diff --git a/addons/sourcemod/scripting/FunModes.sp b/addons/sourcemod/scripting/FunModes.sp index e51dacb..c27a892 100644 --- a/addons/sourcemod/scripting/FunModes.sp +++ b/addons/sourcemod/scripting/FunModes.sp @@ -26,7 +26,7 @@ public Plugin myinfo = name = "FunModes", author = "Dolly", description = "bunch of fun modes for ze mode", - version = "2.8.1", + version = "2.8.2", url = "https://nide.gg" } diff --git a/addons/sourcemod/scripting/Fun_Modes/Core/Core.sp b/addons/sourcemod/scripting/Fun_Modes/Core/Core.sp index d9dd09c..dac7c19 100644 --- a/addons/sourcemod/scripting/Fun_Modes/Core/Core.sp +++ b/addons/sourcemod/scripting/Fun_Modes/Core/Core.sp @@ -62,7 +62,6 @@ Handle g_hSwitchSDKCall; #define MAX_MODES_NUM 32 #define MAX_CVARS_NUM 10 -ModeInfo g_ModesInfo[MAX_MODES_NUM]; int g_iLastModeIndex; /* ConVars Section */ @@ -157,10 +156,7 @@ enum struct FM_ConVar int GetPos() { - int pos = 0; - for (int i = this.modeIndex - 1; i >= 0; i--) - pos += g_ModesInfo[i].GetCvarsCount(); - + int pos = FunModes_GetCvarsCountBeforeMode(this.modeIndex); pos += this.cvarIndex; return pos; } @@ -265,7 +261,8 @@ enum WeaponAmmoGrenadeType /* Modes Forwards Include */ #include "Forwards.sp" -enum struct ModeInfo +/* Modes Section */ +enum struct ModeInfo { int index; char name[32]; @@ -291,6 +288,17 @@ enum struct ModeInfo } } +ModeInfo g_ModesInfo[MAX_MODES_NUM]; + +int FunModes_GetCvarsCountBeforeMode(int modeIndex) +{ + int count; + for (int i = modeIndex - 1; i >= 0; i--) + count += g_ModesInfo[i].GetCvarsCount(); + + return count; +} + /* * Declares a FunModes cvar related to the current mode the compiler is reading. * diff --git a/addons/sourcemod/scripting/Fun_Modes/GunGame.sp b/addons/sourcemod/scripting/Fun_Modes/GunGame.sp index 99a8676..b656665 100644 --- a/addons/sourcemod/scripting/Fun_Modes/GunGame.sp +++ b/addons/sourcemod/scripting/Fun_Modes/GunGame.sp @@ -78,7 +78,7 @@ enum struct GunGame_Data { this.level[0] = 0; this.level[1] = 0; - this.pickupCooldown = 0; + this.pickupCooldown = 0.0; } }