Skip to content

Commit

Permalink
Fix warnings on sm 1.12
Browse files Browse the repository at this point in the history
  • Loading branch information
A1mDev committed Jan 29, 2024
1 parent 0d320bb commit ab33b25
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 59 deletions.
2 changes: 1 addition & 1 deletion 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.4"

// Using these macros, you can disable unnecessary modules,
// and they will not be included in the plugin at compile time,
Expand Down
15 changes: 8 additions & 7 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 @@ -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,13 +139,13 @@ 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]);
}
Expand Down Expand Up @@ -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
13 changes: 7 additions & 6 deletions addons/sourcemod/scripting/confoglcompmod/EntityRemover.sp
Original file line number Diff line number Diff line change
Expand Up @@ -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 @@ -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 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 @@ -359,7 +360,7 @@ public void ER_RoundStart_Event(Event hEvent, const char[] sEventName, bool bdon
public 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
5 changes: 3 additions & 2 deletions addons/sourcemod/scripting/confoglcompmod/MapInfo.sp
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
#endif
#define __map_info_included

#define DEBUG_MI 0
#define DEBUG_MI false
#define MI_MODULE_NAME "MapInfo"

static int
iMapMaxDistance = 0,
iIsInEditMode[MAXPLAYERS + 1] = {0, ...};

static bool
MI_bDebugEnabled = DEBUG_MI,
MapDataAvailable = false;

static float
Expand Down Expand Up @@ -194,7 +195,7 @@ static void MI_KV_Load()
{
char sNameBuff[PLATFORM_MAX_PATH];

if (DEBUG_MI || IsDebugEnabled()) {
if (MI_bDebugEnabled || IsDebugEnabled()) {
LogMessage("[%s] Loading MapInfo KeyValues", MI_MODULE_NAME);
}

Expand Down
35 changes: 18 additions & 17 deletions addons/sourcemod/scripting/confoglcompmod/ReqMatch.sp
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
#endif
#define __reg_match_included

#define RM_DEBUG 0
#define RM_DEBUG false
#define RM_MODULE_NAME "ReqMatch"

#define MAPRESTARTTIME 3.0
#define RESETMINTIME 60.0

static bool
RM_bDebugEnabled = RM_DEBUG,
// RM_bMatchRequest[2] = {false, ...},
RM_bIsMatchModeLoaded = false,
RM_bIsAMatchActive = false,
Expand Down Expand Up @@ -92,7 +93,7 @@ void RM_OnModuleStart()

if (RM_hReloaded.BoolValue)
{
if (RM_DEBUG || IsDebugEnabled())
if (RM_bDebugEnabled || IsDebugEnabled())
{
LogMessage("[%s] Plugin was reloaded from match mode, executing match load", RM_MODULE_NAME);
}
Expand All @@ -116,7 +117,7 @@ void RM_OnMapStart()
return;
}

if (RM_DEBUG || IsDebugEnabled())
if (RM_bDebugEnabled || IsDebugEnabled())
{
LogMessage("[%s] New map, executing match config...", RM_MODULE_NAME);
}
Expand All @@ -140,7 +141,7 @@ void RM_OnClientPutInServer()

static void RM_Match_Load()
{
if (RM_DEBUG || IsDebugEnabled())
if (RM_bDebugEnabled || IsDebugEnabled())
{
LogMessage("[%s] Match Load", RM_MODULE_NAME);
}
Expand All @@ -155,7 +156,7 @@ static void RM_Match_Load()

if (!RM_bIsPluginsLoaded)
{
if (RM_DEBUG || IsDebugEnabled())
if (RM_bDebugEnabled || IsDebugEnabled())
{
LogMessage("[%s] Loading plugins and reload self", RM_MODULE_NAME);
}
Expand Down Expand Up @@ -185,7 +186,7 @@ static void RM_Match_Load()
RM_hConfigFile_On.GetString(sBuffer, sizeof(sBuffer));
ExecuteCfg(sBuffer);

if (RM_DEBUG || IsDebugEnabled())
if (RM_bDebugEnabled || IsDebugEnabled())
{
LogMessage("[%s] Match config executed", RM_MODULE_NAME);
}
Expand All @@ -195,7 +196,7 @@ static void RM_Match_Load()
return;
}

if (RM_DEBUG || IsDebugEnabled())
if (RM_bDebugEnabled || IsDebugEnabled())
{
LogMessage("[%s] Setting match mode active", RM_MODULE_NAME);
}
Expand Down Expand Up @@ -227,7 +228,7 @@ static void RM_Match_Load()
hDp.WriteString(sMap);
}

if (RM_DEBUG || IsDebugEnabled())
if (RM_bDebugEnabled || IsDebugEnabled())
{
LogMessage("[%s] Match mode loaded!", RM_MODULE_NAME);
}
Expand All @@ -244,7 +245,7 @@ static void RM_Match_Unload(bool bForced = false)

if (!bIsHumansOnServer || bForced)
{
if (RM_DEBUG || IsDebugEnabled())
if (RM_bDebugEnabled || IsDebugEnabled())
{
LogMessage("[%s] Match is no longer active, sb_all_bot_game reset to 0, IsHumansOnServer %b, bForced %b", RM_MODULE_NAME, bIsHumansOnServer, bForced);
}
Expand All @@ -258,7 +259,7 @@ static void RM_Match_Unload(bool bForced = false)
return;
}

if (RM_DEBUG || IsDebugEnabled())
if (RM_bDebugEnabled || IsDebugEnabled())
{
LogMessage("[%s] Unloading match mode...", RM_MODULE_NAME);
}
Expand Down Expand Up @@ -290,7 +291,7 @@ static void RM_Match_Unload(bool bForced = false)
ExecuteCfg(sBuffer);
}

if (RM_DEBUG || IsDebugEnabled())
if (RM_bDebugEnabled || IsDebugEnabled())
{
LogMessage("[%s] Match mode unloaded!", RM_MODULE_NAME);
}
Expand All @@ -300,7 +301,7 @@ public Action RM_Match_MapRestart_Timer(Handle hTimer, DataPack hDp)
{
ServerCommand("sm plugins load_lock"); // rework

if (RM_DEBUG || IsDebugEnabled())
if (RM_bDebugEnabled || IsDebugEnabled())
{
LogMessage("[%s] Restarting map...", RM_MODULE_NAME);
}
Expand All @@ -324,7 +325,7 @@ static bool RM_UpdateCfgOn(const char[] cfgfile, bool bIsPrint = true)
// PrintToChatAll("\x01[\x05Confogl\x01] Using \"\x04%s\x01\" config.", cfgfile);
CPrintToChatAll("{blue}[{default}Confogl{blue}]{default} Loading '{olive}%s{default}'.", cfgfile);

if (RM_DEBUG || IsDebugEnabled())
if (RM_bDebugEnabled || IsDebugEnabled())
{
LogMessage("[%s] Starting match on config %s", RM_MODULE_NAME, cfgfile);
}
Expand All @@ -348,7 +349,7 @@ public Action RM_Cmd_ForceMatch(int client, int args)
return Plugin_Handled;
}

if (RM_DEBUG || IsDebugEnabled())
if (RM_bDebugEnabled || IsDebugEnabled())
{
LogMessage("[%s] Match mode forced to load!", RM_MODULE_NAME);
}
Expand Down Expand Up @@ -422,7 +423,7 @@ public Action RM_Cmd_ResetMatch(int client, int args)
return Plugin_Handled;
}

if (RM_DEBUG || IsDebugEnabled())
if (RM_bDebugEnabled || IsDebugEnabled())
{
LogMessage("[%s] Match mode forced to unload!", RM_MODULE_NAME);
}
Expand Down Expand Up @@ -490,7 +491,7 @@ public Action RM_CMD_ChangeMatch(int client, int args)
return Plugin_Handled;
}

if (RM_DEBUG || IsDebugEnabled())
if (RM_bDebugEnabled || IsDebugEnabled())
{
LogMessage("[%s] Match mode forced to unload! [Change in this case!]", RM_MODULE_NAME);
}
Expand All @@ -513,7 +514,7 @@ public Action Timer_DelayToLoadMatchMode(Handle timer)
return Plugin_Handled;
}

if (RM_DEBUG || IsDebugEnabled())
if (RM_bDebugEnabled || IsDebugEnabled())
{
LogMessage("[%s] Match mode forced to load! [Change in this case!]", RM_MODULE_NAME);
}
Expand Down
15 changes: 8 additions & 7 deletions addons/sourcemod/scripting/confoglcompmod/ScoreMod.sp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#endif
#define __scoremod_included

#define DEBUG_SM 0
#define DEBUG_SM false
#define SM_MODULE_NAME "ScoreMod"

static int
Expand All @@ -21,6 +21,7 @@ static float
SM_fTempMulti[3] = {0.0, ...};

static bool
SM_bDebugEnabled = DEBUG_SM,
SM_bEventsHooked = false,
SM_bModuleIsEnabled = false,
SM_bHooked = false,
Expand Down Expand Up @@ -348,7 +349,7 @@ public Action SM_Cmd_Health(int client, int args)

int iScore = RoundToFloor(fAvgHealth * SM_fMapMulti * SM_fHBRatio) * iAliveCount;

if (DEBUG_SM || IsDebugEnabled()) {
if (SM_bDebugEnabled || IsDebugEnabled()) {
LogMessage("[%s] CalcScore: %d MapMulti: %.02f Multiplier %.02f", SM_MODULE_NAME, iScore, SM_fMapMulti, SM_fHBRatio);
}

Expand Down Expand Up @@ -462,11 +463,11 @@ static float SM_CalculateAvgHealth(int &iAliveCount = 0)

// return Average Health Points
float fAvgHealth = (iTotalHealth + fTotalAdjustedTempHealth) / iSurvCount;

#if DEBUG_SM
LogMessage("[%s] TotalPerm: %d TotalAdjustedTemp: %.02f SurvCount: %d AliveCount: %d AvgHealth: %.02f", \
SM_MODULE_NAME, iTotalHealth, fTotalAdjustedTempHealth, iSurvCount, iAliveCount, fAvgHealth);
#endif
if (SM_bDebugEnabled || IsDebugEnabled()) {
LogMessage("[%s] TotalPerm: %d TotalAdjustedTemp: %.02f SurvCount: %d AliveCount: %d AvgHealth: %.02f", \
SM_MODULE_NAME, iTotalHealth, fTotalAdjustedTempHealth, iSurvCount, iAliveCount, fAvgHealth);
}

return fAvgHealth;
}
Expand Down
Loading

0 comments on commit ab33b25

Please sign in to comment.