Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion addons/sourcemod/scripting/FunModes.sp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand Down
20 changes: 14 additions & 6 deletions addons/sourcemod/scripting/Fun_Modes/Core/Core.sp
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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];
Expand All @@ -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.
*
Expand Down
2 changes: 1 addition & 1 deletion addons/sourcemod/scripting/Fun_Modes/GunGame.sp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ enum struct GunGame_Data
{
this.level[0] = 0;
this.level[1] = 0;
this.pickupCooldown = 0;
this.pickupCooldown = 0.0;
}
}

Expand Down