From 891f3ec43220d9f8d6b313635e44669fe23d6254 Mon Sep 17 00:00:00 2001 From: Dolly132 <109222243+Dolly132@users.noreply.github.com> Date: Sat, 15 Aug 2026 16:00:06 +0300 Subject: [PATCH 1/4] fix(compat): support SM1.13 compiler --- addons/sourcemod/scripting/FunModes.sp | 2 +- addons/sourcemod/scripting/Fun_Modes/Core/Core.sp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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..9a2dc7a 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 */ @@ -291,6 +290,8 @@ enum struct ModeInfo } } +ModeInfo g_ModesInfo[MAX_MODES_NUM]; + /* * Declares a FunModes cvar related to the current mode the compiler is reading. * From ff256e6e972f520667406517f3f7cb5c2906fc51 Mon Sep 17 00:00:00 2001 From: Dolly132 <109222243+Dolly132@users.noreply.github.com> Date: Sun, 16 Aug 2026 12:37:18 +0300 Subject: [PATCH 2/4] uhm --- .../scripting/Fun_Modes/Core/Core.sp | 57 ++++++++++--------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/addons/sourcemod/scripting/Fun_Modes/Core/Core.sp b/addons/sourcemod/scripting/Fun_Modes/Core/Core.sp index 9a2dc7a..3ba332b 100644 --- a/addons/sourcemod/scripting/Fun_Modes/Core/Core.sp +++ b/addons/sourcemod/scripting/Fun_Modes/Core/Core.sp @@ -64,6 +64,35 @@ Handle g_hSwitchSDKCall; int g_iLastModeIndex; +/* Modes Section */ +enum struct ModeInfo +{ + int index; + char name[32]; + char tag[64]; + FM_ConVar cvars[MAX_CVARS_NUM]; + bool isOn; + int enableIndex; + + FM_Forwards forwards; + + int GetCvarsCount() + { + int count; + for (int i = 0; i < sizeof(ModeInfo::cvars); i++) + { + if (this.cvars[i].name[0] == '\0') + continue; + + count++; + } + + return count; + } +} + +ModeInfo g_ModesInfo[MAX_MODES_NUM]; + /* ConVars Section */ KeyValues g_hKV; @@ -264,34 +293,6 @@ enum WeaponAmmoGrenadeType /* Modes Forwards Include */ #include "Forwards.sp" -enum struct ModeInfo -{ - int index; - char name[32]; - char tag[64]; - FM_ConVar cvars[MAX_CVARS_NUM]; - bool isOn; - int enableIndex; - - FM_Forwards forwards; - - int GetCvarsCount() - { - int count; - for (int i = 0; i < sizeof(ModeInfo::cvars); i++) - { - if (this.cvars[i].name[0] == '\0') - continue; - - count++; - } - - return count; - } -} - -ModeInfo g_ModesInfo[MAX_MODES_NUM]; - /* * Declares a FunModes cvar related to the current mode the compiler is reading. * From 8e149529f20949ac09c6b8cb83248c0c4dadea38 Mon Sep 17 00:00:00 2001 From: Rushaway Date: Tue, 18 Aug 2026 15:36:26 +0200 Subject: [PATCH 3/4] fix(compat): resolve ModeInfo/FM_ConVar circular type ordering for SM1.12 and SM1.13 Moving ModeInfo above FM_ConVar/Forwards.sp broke compilation on both compilers, since ModeInfo's fields need FM_ConVar and FM_Forwards to be defined first. Restoring ModeInfo/g_ModesInfo to their original position (after FM_ConVar and Forwards.sp) fixes the missing-type errors, but FM_ConVar::GetPos() referenced g_ModesInfo before its declaration point, which SM1.12 rejects for global variables (unlike functions, which may be forward-referenced). Extracting that lookup into a free function called from GetPos() breaks the ordering constraint since functions can be referenced ahead of their definition. --- .../scripting/Fun_Modes/Core/Core.sp | 72 ++++++++++--------- 1 file changed, 39 insertions(+), 33 deletions(-) diff --git a/addons/sourcemod/scripting/Fun_Modes/Core/Core.sp b/addons/sourcemod/scripting/Fun_Modes/Core/Core.sp index 3ba332b..dac7c19 100644 --- a/addons/sourcemod/scripting/Fun_Modes/Core/Core.sp +++ b/addons/sourcemod/scripting/Fun_Modes/Core/Core.sp @@ -64,35 +64,6 @@ Handle g_hSwitchSDKCall; int g_iLastModeIndex; -/* Modes Section */ -enum struct ModeInfo -{ - int index; - char name[32]; - char tag[64]; - FM_ConVar cvars[MAX_CVARS_NUM]; - bool isOn; - int enableIndex; - - FM_Forwards forwards; - - int GetCvarsCount() - { - int count; - for (int i = 0; i < sizeof(ModeInfo::cvars); i++) - { - if (this.cvars[i].name[0] == '\0') - continue; - - count++; - } - - return count; - } -} - -ModeInfo g_ModesInfo[MAX_MODES_NUM]; - /* ConVars Section */ KeyValues g_hKV; @@ -185,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; } @@ -293,6 +261,44 @@ enum WeaponAmmoGrenadeType /* Modes Forwards Include */ #include "Forwards.sp" +/* Modes Section */ +enum struct ModeInfo +{ + int index; + char name[32]; + char tag[64]; + FM_ConVar cvars[MAX_CVARS_NUM]; + bool isOn; + int enableIndex; + + FM_Forwards forwards; + + int GetCvarsCount() + { + int count; + for (int i = 0; i < sizeof(ModeInfo::cvars); i++) + { + if (this.cvars[i].name[0] == '\0') + continue; + + count++; + } + + return count; + } +} + +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. * From 3b97a64caeedcab1e75ee6e659e728c76191c76a Mon Sep 17 00:00:00 2001 From: Dolly132 <109222243+Dolly132@users.noreply.github.com> Date: Tue, 18 Aug 2026 16:42:07 +0300 Subject: [PATCH 4/4] fix warning --- addons/sourcemod/scripting/Fun_Modes/GunGame.sp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } }