Skip to content

Commit 15b2649

Browse files
authored
fix(warnings): satisfy compiler on SM 1.13 (#1038)
1 parent 6ac4ca2 commit 15b2649

File tree

4 files changed

+32
-24
lines changed

4 files changed

+32
-24
lines changed

game/addons/sourcemod/scripting/include/sourcebanspp.inc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@
2929
#endif
3030
#define _sourcebanspp_included
3131

32+
#define SB_VERSION_MAJOR "1"
33+
#define SB_VERSION_MINOR "8"
34+
#define SB_VERSION_PATCH "4"
35+
36+
#define SB_VERSION SB_VERSION_MAJOR..."."...SB_VERSION_MINOR..."."...SB_VERSION_PATCH
37+
3238
public SharedPlugin __pl_sourcebanspp =
3339
{
3440
name = "sourcebans++",

game/addons/sourcemod/scripting/include/sourcecomms.inc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@
2929
#endif
3030
#define _sourcecomms_included
3131

32+
#define SBPPComms_VERSION_MAJOR "1"
33+
#define SBPPComms_VERSION_MINOR "8"
34+
#define SBPPComms_VERSION_PATCH "3"
35+
36+
#define SBPPComms_VERSION SBPPComms_VERSION_MAJOR..."."...SBPPComms_VERSION_MINOR..."."...SBPPComms_VERSION_PATCH
37+
3238
/**
3339
* @section Int definitions for punishments types.
3440
*/
@@ -134,5 +140,4 @@ public void __pl_sourcecomms_SetNTVOptional()
134140
MarkNativeAsOptional("SourceComms_SetClientGag");
135141
MarkNativeAsOptional("SourceComms_GetClientMuteType");
136142
MarkNativeAsOptional("SourceComms_GetClientGagType");
137-
138143
}

game/addons/sourcemod/scripting/sbpp_comms.sp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
// Do not edit below this line //
4444
//-----------------------------//
4545

46-
#define PLUGIN_VERSION "1.8.1"
4746
#define PREFIX "\x04[SourceComms++]\x01 "
4847

4948
//GLOBAL DEFINES
@@ -134,10 +133,10 @@ int
134133

135134
SMCParser ConfigParser;
136135

137-
Handle
138-
g_hFwd_OnPlayerPunished
139-
, g_hFwd_OnPlayerUnpunished
140-
, g_hGagExpireTimer[MAXPLAYERS + 1] = { null, ... }
136+
GlobalForward g_hFwd_OnPlayerPunished
137+
, g_hFwd_OnPlayerUnpunished;
138+
139+
Handle g_hGagExpireTimer[MAXPLAYERS + 1] = { null, ... }
141140
, g_hMuteExpireTimer[MAXPLAYERS + 1] = { null, ... };
142141

143142
bType g_MuteType[MAXPLAYERS + 1];
@@ -170,7 +169,7 @@ public Plugin myinfo =
170169
name = "SourceBans++: SourceComms",
171170
author = "Alex, SourceBans++ Dev Team",
172171
description = "Advanced punishments management for the Source engine in SourceBans style",
173-
version = PLUGIN_VERSION,
172+
version = SBPPComms_VERSION,
174173
url = "https://sbpp.github.io"
175174
};
176175

@@ -203,7 +202,7 @@ public void OnPluginStart()
203202
CvarPort = FindConVar("hostport");
204203
g_hServersWhiteList = new ArrayList();
205204

206-
CreateConVar("sourcecomms_version", PLUGIN_VERSION, _, FCVAR_SPONLY | FCVAR_REPLICATED | FCVAR_NOTIFY);
205+
CreateConVar("sourcecomms_version", SBPPComms_VERSION, _, FCVAR_SPONLY | FCVAR_REPLICATED | FCVAR_NOTIFY);
207206
AddCommandListener(CommandCallback, "sm_gag");
208207
AddCommandListener(CommandCallback, "sm_mute");
209208
AddCommandListener(CommandCallback, "sm_silence");
@@ -222,7 +221,7 @@ public void OnPluginStart()
222221
#endif
223222

224223
#if defined DEBUG
225-
PrintToServer("Sourcecomms plugin loading. Version %s", PLUGIN_VERSION);
224+
PrintToServer("Sourcecomms plugin loading. Version %s", SBPPComms_VERSION);
226225
#endif
227226

228227
// Catch config error
@@ -660,7 +659,7 @@ public Action CommandCallback(int client, const char[] command, int args)
660659
if (type <= TYPE_SILENCE)
661660
CreateBlock(client, _, _, type, _, sBuffer);
662661
else
663-
ProcessUnBlock(client, _, type, _, sBuffer);
662+
ProcessUnBlock(client, _, type, sBuffer);
664663

665664
return Plugin_Stop;
666665
}
@@ -2430,10 +2429,10 @@ stock void CreateBlock(int client, int targetId = 0, int length = -1, int type,
24302429
return;
24312430
}
24322431

2433-
stock void ProcessUnBlock(int client, int targetId = 0, int type, char[] sReason = "", const char[] sArgs = "")
2432+
stock void ProcessUnBlock(int client, int targetId = 0, int type, char[] sReason = "")
24342433
{
24352434
#if defined DEBUG
2436-
PrintToServer("ProcessUnBlock(admin: %d, target: %d, type: %d, reason: %s, args: %s)", client, targetId, type, sReason, sArgs);
2435+
PrintToServer("ProcessUnBlock(admin: %d, target: %d, type: %d, reason: %s)", client, targetId, type, sReason);
24372436
#endif
24382437

24392438
int target_list[MAXPLAYERS], target_count;

game/addons/sourcemod/scripting/sbpp_main.sp

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535

3636
#pragma newdecls required
3737

38-
#define SB_VERSION "1.8.2"
39-
4038
#if defined _updater_included
4139
#define UPDATE_URL "https://sbpp.github.io/updater/updatefile.txt"
4240
#endif
@@ -120,11 +118,11 @@ int
120118

121119
SMCParser ConfigParser;
122120

123-
Handle
124-
g_hFwd_OnBanAdded
125-
, g_hFwd_OnReportAdded
126-
, g_hFwd_OnClientPreAdminCheck
127-
, PlayerRecheck[MAXPLAYERS + 1] = { INVALID_HANDLE, ... }; /* Timer handle */
121+
GlobalForward g_hFwd_OnBanAdded
122+
, g_hFwd_OnReportAdded
123+
, g_hFwd_OnClientPreAdminCheck;
124+
125+
Handle PlayerRecheck[MAXPLAYERS + 1] = { INVALID_HANDLE, ... }; /* Timer handle */
128126

129127
DataPack PlayerDataPack[MAXPLAYERS + 1] = { null, ... };
130128

@@ -433,7 +431,7 @@ public Action ChatHook(int client, int args)
433431
}
434432

435433
// ban him!
436-
PrepareBan(client, g_BanTarget[client], g_BanTime[client], reason, sizeof(reason));
434+
PrepareBan(client, g_BanTarget[client], g_BanTime[client], reason);
437435

438436
// block the reason to be sent in chat
439437
return Plugin_Handled;
@@ -863,7 +861,7 @@ public int ReasonSelected(Menu menu, MenuAction action, int param1, int param2)
863861
}
864862

865863
else if (g_BanTarget[param1] != -1 && g_BanTime[param1] != -1)
866-
PrepareBan(param1, g_BanTarget[param1], g_BanTime[param1], info, sizeof(info));
864+
PrepareBan(param1, g_BanTarget[param1], g_BanTime[param1], info);
867865
}
868866

869867
case MenuAction_Cancel:
@@ -896,7 +894,7 @@ public int HackingSelected(Menu menu, MenuAction action, int param1, int param2)
896894
menu.GetItem(param2, key, sizeof(key), _, info, sizeof(info));
897895

898896
if (g_BanTarget[param1] != -1 && g_BanTime[param1] != -1)
899-
PrepareBan(param1, g_BanTarget[param1], g_BanTime[param1], info, sizeof(info));
897+
PrepareBan(param1, g_BanTarget[param1], g_BanTime[param1], info);
900898
}
901899

902900
case MenuAction_Cancel:
@@ -2387,7 +2385,7 @@ public int Native_SBBanPlayer(Handle plugin, int numParams)
23872385
}
23882386
}
23892387

2390-
PrepareBan(client, target, time, reason, sizeof(reason));
2388+
PrepareBan(client, target, time, reason);
23912389
return true;
23922390
}
23932391

@@ -2662,7 +2660,7 @@ stock void InsertServerInfo()
26622660
}
26632661
}
26642662

2665-
stock void PrepareBan(int client, int target, int time, char[] reason, int size)
2663+
stock void PrepareBan(int client, int target, int time, char[] reason)
26662664
{
26672665
#if defined DEBUG
26682666
LogToFile(logFile, "PrepareBan()");

0 commit comments

Comments
 (0)