Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[confoglcompmod] Fix warnings on sm 1.12 #734

Merged
merged 2 commits into from
Feb 11, 2024
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
4 changes: 2 additions & 2 deletions addons/sourcemod/scripting/confoglcompmod.sp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#define DEBUG_ALL 0

#define PLUGIN_VERSION "2.4.3"
#define PLUGIN_VERSION "2.4.5"

// Using these macros, you can disable unnecessary modules,
// and they will not be included in the plugin at compile time,
Expand Down Expand Up @@ -500,7 +500,7 @@ public Action L4D_OnFirstSurvivorLeftSafeArea(int client)
return Plugin_Continue;
}

public Action OFSLA_ForceMobSpawnTimer(Handle hTimer)
static Action OFSLA_ForceMobSpawnTimer(Handle hTimer)
{
// Workaround to make tank horde blocking always work
// Makes the first horde always start 100s after survivors leave saferoom
Expand Down
25 changes: 13 additions & 12 deletions addons/sourcemod/scripting/confoglcompmod/BossSpawning.sp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#endif
#define __boss_spawning_included

#define DEBUG_BS 0
#define DEBUG_BS false
#define BS_MODULE_NAME "BossSpawning"

#define MAX_TANKS 5
Expand All @@ -14,6 +14,7 @@ static char
BS_sMap[64] = "\0";

static bool
BS_bDebugEnabled = DEBUG_BS,
BS_bEnabled = true,
BS_bIsFirstRound = true,
BS_bDeleteWitches = false,
Expand Down Expand Up @@ -57,12 +58,12 @@ void BS_OnMapStart()
GetCurrentMap(BS_sMap, sizeof(BS_sMap));
}

public void BS_ConVarChange(ConVar convar, const char[] oldValue, const char[] newValue)
static void BS_ConVarChange(ConVar convar, const char[] oldValue, const char[] newValue)
{
BS_bEnabled = BS_hEnabled.BoolValue;
}

public void BS_WitchSpawn(Event hEvent, const char[] sEventName, bool bDontBroadcast)
static void BS_WitchSpawn(Event hEvent, const char[] sEventName, bool bDontBroadcast)
{
if (!BS_bEnabled || !IsPluginEnabled()) {
return;
Expand Down Expand Up @@ -123,13 +124,13 @@ void BS_OnTankSpawnPost_Forward(int iTankClient)
return;
}

if (DEBUG_BS || IsDebugEnabled()) {
if (BS_bDebugEnabled || IsDebugEnabled()) {
LogMessage("[%s] Tracking this tank spawn. Currently, %d tanks", BS_MODULE_NAME, BS_iTankCount[view_as<int>(!BS_bIsFirstRound)]);
}

if (BS_bIsFirstRound) {
GetClientAbsOrigin(iTankClient, BS_fTankSpawn[BS_iTankCount[0]]);
if (DEBUG_BS || IsDebugEnabled()) {
if (BS_bDebugEnabled || IsDebugEnabled()) {
LogMessage("[%s] Saving tank at %f %f %f", \
BS_MODULE_NAME, BS_fTankSpawn[BS_iTankCount[0]][0], BS_fTankSpawn[BS_iTankCount[0]][1], BS_fTankSpawn[BS_iTankCount[0]][2]);
}
Expand All @@ -138,19 +139,19 @@ void BS_OnTankSpawnPost_Forward(int iTankClient)
} else if (BS_iTankCount[0] > BS_iTankCount[1]) {
TeleportEntity(iTankClient, BS_fTankSpawn[BS_iTankCount[1]], NULL_VECTOR, NULL_VECTOR);

if (DEBUG_BS || IsDebugEnabled()) {
if (BS_bDebugEnabled || IsDebugEnabled()) {
LogMessage("[%s] Teleporting tank to tank at %f %f %f", \
BS_MODULE_NAME, BS_fTankSpawn[BS_iTankCount[1]][0], BS_fTankSpawn[BS_iTankCount[1]][1], BS_fTankSpawn[BS_iTankCount[1]][2]);
}

BS_iTankCount[1]++;
} else if (DEBUG_BS || IsDebugEnabled()) {
} else if (BS_bDebugEnabled || IsDebugEnabled()) {
LogMessage("[%s] Not first round and not acceptable tank", BS_MODULE_NAME);
LogMessage("[%s] IsFirstRound: %d R1Count: %d R2Count: %d", BS_MODULE_NAME, BS_bIsFirstRound, BS_iTankCount[0], BS_iTankCount[1]);
}
}

public void BS_RoundEnd(Event hEvent, const char[] sEventName, bool bDontBroadcast)
static void BS_RoundEnd(Event hEvent, const char[] sEventName, bool bDontBroadcast)
{
BS_bIsFirstRound = false;
BS_bFinaleStarted = false;
Expand All @@ -164,12 +165,12 @@ public void BS_RoundEnd(Event hEvent, const char[] sEventName, bool bDontBroadca
}
}

public void BS_FinaleStart(Event hEvent, const char[] sEventName, bool bDontBroadcast)
static void BS_FinaleStart(Event hEvent, const char[] sEventName, bool bDontBroadcast)
{
BS_bFinaleStarted = true;
}

public Action BS_WitchTimerReset(Handle hTimer)
static Action BS_WitchTimerReset(Handle hTimer)
{
BS_bDeleteWitches = false;

Expand All @@ -183,7 +184,7 @@ static void FixZDistance(int iTankClient)
float WarpToLocation[3], TankLocation[3], TempSurvivorLocation[3];
GetClientAbsOrigin(iTankClient, TankLocation);

if (DEBUG_BS || IsDebugEnabled()) {
if (BS_bDebugEnabled || IsDebugEnabled()) {
LogMessage("[%s] tank z spawn check... Map: %s, Tank Location: %f, %f, %f", BS_MODULE_NAME, BS_sMap, TankLocation[0], TankLocation[1], TankLocation[2]);
}

Expand All @@ -194,7 +195,7 @@ static void FixZDistance(int iTankClient)
if (index != 0 && IsValidEntity(index)) {
GetClientAbsOrigin(index, TempSurvivorLocation);

if (DEBUG_BS || IsDebugEnabled()) {
if (BS_bDebugEnabled || IsDebugEnabled()) {
LogMessage("[%s] Survivor %d Location: %f, %f, %f", BS_MODULE_NAME, i, TempSurvivorLocation[0], TempSurvivorLocation[1], TempSurvivorLocation[2]);
}

Expand Down
8 changes: 4 additions & 4 deletions addons/sourcemod/scripting/confoglcompmod/BotKick.sp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void BK_OnModuleStart()
HookEvent("player_bot_replace", BK_PlayerBotReplace);
}

public void BK_ConVarChange(ConVar hConVar, const char[] sOldValue, const char[] sNewValue)
static void BK_ConVarChange(ConVar hConVar, const char[] sOldValue, const char[] sNewValue)
{
BK_iEnable = BK_hEnable.IntValue;
}
Expand Down Expand Up @@ -68,7 +68,7 @@ bool BK_OnClientConnect(int iClient)
return false;
}

public Action BK_CheckInfBotReplace_Timer(Handle hTimer, any iClient)
static Action BK_CheckInfBotReplace_Timer(Handle hTimer, any iClient)
{
if (iClient != BK_lastvalidbot && IsClientInGame(iClient) && IsFakeClient(iClient)) {
KickClient(iClient, "[Confogl] Kicking late infected bot...");
Expand All @@ -79,7 +79,7 @@ public Action BK_CheckInfBotReplace_Timer(Handle hTimer, any iClient)
return Plugin_Stop;
}

public void BK_PlayerBotReplace(Event hEvent, const char[] sEventName, bool bDontBroadcast)
static void BK_PlayerBotReplace(Event hEvent, const char[] sEventName, bool bDontBroadcast)
{
if (!GT_IsTankInPlay()) {
return;
Expand All @@ -93,7 +93,7 @@ public void BK_PlayerBotReplace(Event hEvent, const char[] sEventName, bool bDon
}
}

public Action BK_CancelValidBot_Timer(Handle hTimer)
static Action BK_CancelValidBot_Timer(Handle hTimer)
{
BK_lastvalidbot = -1;

Expand Down
12 changes: 6 additions & 6 deletions addons/sourcemod/scripting/confoglcompmod/ClientSettings.sp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static void ClearCLSEntry(CLSEntry entry[CLSEntry])
}
#endif*/

public Action _CheckClientSettings_Timer(Handle hTimer)
static Action _CheckClientSettings_Timer(Handle hTimer)
{
if (!IsPluginEnabled()) {
if (IsDebugEnabled()) {
Expand Down Expand Up @@ -129,7 +129,7 @@ static void EnforceCliSettings(int client)
#endif
}

public void _EnforceCliSettings_QueryReply(QueryCookie cookie, int client, ConVarQueryResult result, \
static void _EnforceCliSettings_QueryReply(QueryCookie cookie, int client, ConVarQueryResult result, \
const char[] cvarName, const char[] cvarValue, any value)
{
if (!IsClientConnected(client) || !IsClientInGame(client) || IsClientInKickQueue(client)) {
Expand Down Expand Up @@ -225,7 +225,7 @@ public void _EnforceCliSettings_QueryReply(QueryCookie cookie, int client, ConVa
#endif
}

public Action _ClientSettings_Cmd(int client, int args)
static Action _ClientSettings_Cmd(int client, int args)
{
int iSize = ClientSettingsArray.Length;
ReplyToCommand(client, "[Confogl] Tracked Client CVars (Total %d)", iSize);
Expand Down Expand Up @@ -290,7 +290,7 @@ public Action _ClientSettings_Cmd(int client, int args)
return Plugin_Handled;
}

public Action _TrackClientCvar_Cmd(int args)
static Action _TrackClientCvar_Cmd(int args)
{
if (args < 3 || args == 4) {
PrintToServer("Usage: confogl_trackclientcvar <cvar> <hasMin> <min> [<hasMax> <max> [<action>]]");
Expand Down Expand Up @@ -347,7 +347,7 @@ public Action _TrackClientCvar_Cmd(int args)
return Plugin_Handled;
}

public Action _ResetTracking_Cmd(int args)
static Action _ResetTracking_Cmd(int args)
{
if (ClientSettingsCheckTimer != null) {
PrintToServer("Can't reset tracking in the middle of a match");
Expand All @@ -360,7 +360,7 @@ public Action _ResetTracking_Cmd(int args)
return Plugin_Handled;
}

public Action _StartClientChecking_Cmd(int args)
static Action _StartClientChecking_Cmd(int args)
{
_StartTracking();

Expand Down
12 changes: 6 additions & 6 deletions addons/sourcemod/scripting/confoglcompmod/CvarSettings.sp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void CVS_OnConfigsExecuted()
}
}

public Action CVS_SetCvars_Cmd(int args)
static Action CVS_SetCvars_Cmd(int args)
{
if (!IsPluginEnabled()) {
return Plugin_Handled;
Expand All @@ -81,7 +81,7 @@ public Action CVS_SetCvars_Cmd(int args)
return Plugin_Handled;
}

public Action CVS_AddCvar_Cmd(int args)
static Action CVS_AddCvar_Cmd(int args)
{
if (args != 2) {
PrintToServer("Usage: confogl_addcvar <cvar> <newValue>");
Expand All @@ -104,7 +104,7 @@ public Action CVS_AddCvar_Cmd(int args)
return Plugin_Handled;
}

public Action CVS_ResetCvars_Cmd(int args)
static Action CVS_ResetCvars_Cmd(int args)
{
if (IsPluginEnabled()) {
PrintToServer("Can't reset tracking in the middle of a match");
Expand All @@ -117,7 +117,7 @@ public Action CVS_ResetCvars_Cmd(int args)
return Plugin_Handled;
}

public Action CVS_CvarSettings_Cmd(int client, int args)
static Action CVS_CvarSettings_Cmd(int client, int args)
{
if (!IsPluginEnabled()) {
return Plugin_Handled;
Expand Down Expand Up @@ -176,7 +176,7 @@ public Action CVS_CvarSettings_Cmd(int client, int args)
return Plugin_Handled;
}

public Action CVS_CvarDiff_Cmd(int client, int args)
static Action CVS_CvarDiff_Cmd(int client, int args)
{
if (!IsPluginEnabled()) {
return Plugin_Handled;
Expand Down Expand Up @@ -389,7 +389,7 @@ static void AddCvar(const char[] cvar, const char[] newval)
#endif
}

public void CVS_ConVarChange(ConVar hConVar, const char[] sOldValue, const char[] sNewValue)
static void CVS_ConVarChange(ConVar hConVar, const char[] sOldValue, const char[] sNewValue)
{
if (bTrackingStarted) {
char sName[CVS_CVAR_MAXLEN];
Expand Down
23 changes: 12 additions & 11 deletions addons/sourcemod/scripting/confoglcompmod/EntityRemover.sp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#define ER_MODULE_NAME "EntityRemover"

#define DEBUG_ER 0
#define DEBUG_ER false

#define ER_KV_ACTION_KILL 1

Expand All @@ -21,6 +21,7 @@
#define ER_KV_CONDITION_CONTAINS 5

static bool
ER_bDebugEnabled = DEBUG_ER,
ER_bKillParachutist = true,
ER_bReplaceGhostHurt = false;

Expand Down Expand Up @@ -54,7 +55,7 @@ void ER_OnModuleStart()
HookEvent("round_start", ER_RoundStart_Event, EventHookMode_PostNoCopy);
}

public void ER_ConVarChange(ConVar hConvar, const char[] sOldValue, const char[] sNewValue)
static void ER_ConVarChange(ConVar hConvar, const char[] sOldValue, const char[] sNewValue)
{
ER_bKillParachutist = ER_hKillParachutist.BoolValue;
ER_bReplaceGhostHurt = ER_hReplaceGhostHurt.BoolValue;
Expand All @@ -77,7 +78,7 @@ static void ER_KV_Load()
{
char sNameBuff[PLATFORM_MAX_PATH], sDescBuff[256], sValBuff[32];

if (DEBUG_ER || IsDebugEnabled()) {
if (ER_bDebugEnabled || IsDebugEnabled()) {
LogMessage("[%s] Loading EntityRemover KeyValues", ER_MODULE_NAME);
}

Expand All @@ -92,7 +93,7 @@ static void ER_KV_Load()
}

// Create cvars for all entity removes
if (DEBUG_ER || IsDebugEnabled()) {
if (ER_bDebugEnabled || IsDebugEnabled()) {
LogMessage("[%s] Creating entry CVARs", ER_MODULE_NAME);
}

Expand All @@ -108,7 +109,7 @@ static void ER_KV_Load()

CreateConVarEx(sNameBuff, sValBuff, sDescBuff);

if (DEBUG_ER || IsDebugEnabled()) {
if (ER_bDebugEnabled || IsDebugEnabled()) {
LogMessage("[%s] Creating CVAR %s", ER_MODULE_NAME, sNameBuff);
}

Expand All @@ -120,7 +121,7 @@ static void ER_KV_Load()
kERData.Rewind();
}

public Action ER_KV_CmdReload(int client, int args)
static Action ER_KV_CmdReload(int client, int args)
{
if (!IsPluginEnabled()) {
return Plugin_Continue;
Expand Down Expand Up @@ -266,7 +267,7 @@ static bool ER_KV_TakeAction(int action, int iEntity)
{
switch (action) {
case ER_KV_ACTION_KILL: {
if (DEBUG_ER || IsDebugEnabled()) {
if (ER_bDebugEnabled || IsDebugEnabled()) {
LogMessage("[%s] Killing!", ER_MODULE_NAME);
}

Expand Down Expand Up @@ -347,7 +348,7 @@ static bool ER_ReplaceTriggerHurtGhost(int ent)
return false;
}

public void ER_RoundStart_Event(Event hEvent, const char[] sEventName, bool bdontBroadcast)
static void ER_RoundStart_Event(Event hEvent, const char[] sEventName, bool bdontBroadcast)
{
if (!IsPluginEnabled()) {
return;
Expand All @@ -356,10 +357,10 @@ public void ER_RoundStart_Event(Event hEvent, const char[] sEventName, bool bdon
CreateTimer(0.3, ER_RoundStart_Timer, _, TIMER_FLAG_NO_MAPCHANGE);
}

public Action ER_RoundStart_Timer(Handle hTimer)
static Action ER_RoundStart_Timer(Handle hTimer)
{
char sBuffer[MAX_ENTITY_NAME_LENGTH];
if (DEBUG_ER || IsDebugEnabled()) {
if (ER_bDebugEnabled || IsDebugEnabled()) {
LogMessage("[%s] Starting RoundStart Event", ER_MODULE_NAME);
}

Expand All @@ -381,7 +382,7 @@ public Action ER_RoundStart_Timer(Handle hTimer)
} else if (ER_bReplaceGhostHurt && ER_ReplaceTriggerHurtGhost(ent)) {
//empty
} else if (kERData != null && kERData.JumpToKey(sBuffer)) {
if (DEBUG_ER || IsDebugEnabled()) {
if (ER_bDebugEnabled || IsDebugEnabled()) {
LogMessage("[%s] Dealing with an instance of %s", ER_MODULE_NAME, sBuffer);
}

Expand Down
8 changes: 4 additions & 4 deletions addons/sourcemod/scripting/confoglcompmod/FinaleSpawn.sp
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ void FS_OnModuleStart()
HookEvent("finale_start", FS_FinaleStart_Event, EventHookMode_PostNoCopy);
}

public void FS_Round_Event(Event hEvent, const char[] sEventName, bool bDontBroadcast)
static void FS_Round_Event(Event hEvent, const char[] sEventName, bool bDontBroadcast)
{
FS_bIsFinale = false;
}

public void FS_FinaleStart_Event(Event hEvent, const char[] sEventName, bool bDontBroadcast)
static void FS_FinaleStart_Event(Event hEvent, const char[] sEventName, bool bDontBroadcast)
{
FS_bIsFinale = true;
}

public void FS_ConVarChange(ConVar hConVar, const char[] sOldValue, const char[] sNewValue)
static void FS_ConVarChange(ConVar hConVar, const char[] sOldValue, const char[] sNewValue)
{
FS_bEnabled = FS_hEnabled.BoolValue;
}
Expand All @@ -46,7 +46,7 @@ void FS_OnClientPutInServer(int client)
SDKHook(client, SDKHook_PreThinkPost, HookCallback);
}

public void HookCallback(int client)
static void HookCallback(int client)
{
if (!FS_bIsFinale) {
return;
Expand Down
Loading
Loading