Skip to content

Commit

Permalink
Fixed several warnings in 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 d24bbf6
Show file tree
Hide file tree
Showing 14 changed files with 65 additions and 69 deletions.
3 changes: 1 addition & 2 deletions addons/sourcemod/scripting/l4d2_blind_infected.sp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#define ENT_CHECK_INTERVAL 1.0
#define TRACE_TOLERANCE 75.0
#define ENTITY_MAX_NAME_LENGTH 64

enum
{
Expand Down Expand Up @@ -61,7 +60,7 @@ public Plugin myinfo =
name = "Blind Infected",
author = "CanadaRox, ProdigySim, A1m`",
description = "Hides specified weapons from the infected team until they are (possibly) visible to one of the survivors to prevent SI scouting the map",
version = "1.2.1",
version = "1.2.2",
url = "https://github.com/SirPlease/L4D2-Competitive-Rework"
};

Expand Down
4 changes: 1 addition & 3 deletions addons/sourcemod/scripting/l4d2_ladder_rambos.sp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#define PLUGIN_VERSION "4.2"
#define PLUGIN_VERSION "4.2.1"

/*
* Ladder Rambos Dhooks
Expand Down Expand Up @@ -38,8 +38,6 @@
#include <sourcemod>
#include <sdktools>
#include <dhooks>

#define REQUIRE_EXTENSIONS
#include <sourcescramble>

#define GAMEDATA "l4d2_ladderrambos"
Expand Down
3 changes: 1 addition & 2 deletions addons/sourcemod/scripting/l4d2_magnum_incap.sp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#define L4D2UTIL_STOCKS_ONLY 1
#include <l4d2util>

#define ENTITY_MAX_NAME_LENGTH 64
#define DEBUG 0

ConVar g_hReplaceMagnum = null;
Expand All @@ -17,7 +16,7 @@ public Plugin myinfo =
name = "Magnum incap remover",
author = "robex, Sir",
description = "Replace magnum with regular pistols when incapped.",
version = "0.4",
version = "0.4.1",
url = "https://github.com/SirPlease/L4D2-Competitive-Rework"
};

Expand Down
10 changes: 4 additions & 6 deletions addons/sourcemod/scripting/l4d2_nosey_parker.sp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
#define L4D2UTIL_STOCKS_ONLY 1
#include <l4d2util>

#define TEAM_SURVIVOR 2
#define TEAM_INFECTED 3
#define ARRAY_INDEX_TIMESTAMP 0 //DT_IntervalTimer

ConVar
Expand All @@ -48,7 +46,7 @@ public Plugin myinfo =
{
name = "L4D2 Display Infected HP",
author = "Visor, A1m`",
version = "1.5.2",
version = "1.5.3",
description = "Survivors receive damage reports after they get capped",
url = "https://github.com/SirPlease/L4D2-Competitive-Rework"
};
Expand Down Expand Up @@ -85,7 +83,7 @@ public void Event_PlayerHurt(Event hEvent, const char[] sEventName, bool bDontBr
int iVictim = GetClientOfUserId(hEvent.GetInt("userid"));
if (iVictim > 0
&& IsClientInGame(iVictim)
&& GetClientTeam(iVictim) == TEAM_INFECTED
&& GetClientTeam(iVictim) == TEAM_ZOMBIE
&& IsTargetedSi(iVictim) > 0
) {

Expand All @@ -106,7 +104,7 @@ public void Event_PlayerDeath(Event hEvent, const char[] sEventName, bool bDontB
int iClient = GetClientOfUserId(hEvent.GetInt("userid"));
if (iClient == 0
|| !IsClientInGame(iClient)
|| GetClientTeam(iClient) != TEAM_INFECTED
|| GetClientTeam(iClient) != TEAM_ZOMBIE
) {
return;
}
Expand All @@ -130,7 +128,7 @@ public void Event_CHJ_Attack(Event hEvent, const char[] sEventName, bool bDontBr
int iAttacker = GetClientOfUserId(hEvent.GetInt("userid"));
if (iAttacker == 0
|| !IsClientInGame(iAttacker)
|| GetClientTeam(iAttacker) != TEAM_INFECTED
|| GetClientTeam(iAttacker) != TEAM_ZOMBIE
|| !IsPlayerAlive(iAttacker)
) {
return;
Expand Down
5 changes: 1 addition & 4 deletions addons/sourcemod/scripting/l4d2_pickup.sp
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@
#define FLAGS_INCAP_TANKPUNCH 2
#define FLAGS_INCAP_TANKROCK 4

#define TEAM_SURVIVOR 2
#define TEAM_INFECTED 3

bool
bLateLoad,
bTanked[MAXPLAYERS + 1],
Expand Down Expand Up @@ -72,7 +69,7 @@ public Plugin myinfo =
name = "L4D2 Pick-up Changes",
author = "Sir, A1m`",
description = "Alters a few things regarding picking up/giving items and incapped Players.",
version = "1.2.2",
version = "1.2.3",
url = "https://github.com/SirPlease/L4D2-Competitive-Rework/"
}

Expand Down
3 changes: 1 addition & 2 deletions addons/sourcemod/scripting/l4d2_riotcops.sp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <l4d2util>

#define PARISH_PREFIX "c5m"
#define HITGROUP_HEAD 1

bool
g_bPluginActive = false;
Expand All @@ -37,7 +36,7 @@ public Plugin myinfo =
{
name = "L4D2 Riot Cops",
author = "Jahze, Visor, A1m`",
version = "1.6",
version = "1.6.1",
description = "Allow riot cops to be killed by a headshot"
}

Expand Down
56 changes: 37 additions & 19 deletions addons/sourcemod/scripting/l4d2_scoremod.sp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#include <left4dhooks>
#undef REQUIRE_PLUGIN
#include <l4d2lib>
#include <colors>
#define REQUIRE_PLUGIN
#include <colors>

#define DEBUG_SM 0

Expand All @@ -15,7 +15,7 @@ public Plugin myinfo =
name = "L4D2 Scoremod",
author = "CanadaRox, ProdigySim",
description = "L4D2 Custom Scoring System (Health Bonus)",
version = "1.1.1",
version = "1.1.2",
url = "https://bitbucket.org/CanadaRox/random-sourcemod-stuff"
};

Expand Down Expand Up @@ -124,24 +124,22 @@ public OnPluginStart()
SM_iAdrenPercent = GetConVarInt(SM_hAdrenPercent);

RegConsoleCmd("sm_health", SM_Cmd_Health);
}

public OnAllPluginsLoaded()
{

l4d2lib_available = LibraryExists("l4d2lib");

}

public OnLibraryRemoved(const String:name[])
{
if (StrEqual(name, "l4d2lib"))
if (strcmp(name, "l4d2lib") == 0)
{
l4d2lib_available = false;
}
}

public OnLibraryAdded(const String:name[])
{
if (StrEqual(name, "l4d2lib"))
if (strcmp(name, "l4d2lib") == 0)
{
l4d2lib_available = true;
}
Expand Down Expand Up @@ -184,20 +182,37 @@ public SM_ConVarChanged_Enable(Handle:convar, const String:oldValue[], const Str
{
PluginDisable();
SM_bModuleIsEnabled = false;
return;
}
else
{
PluginEnable();
SM_bModuleIsEnabled = true;
}

PluginEnable();
SM_bModuleIsEnabled = true;
}

public SM_ConVarChanged_TempMulti0(Handle:convar, const String:oldValue[], const String:newValue[])
{
SM_fTempMulti[0] = StringToFloat(newValue);
}

public SM_ConVarChanged_TempMulti0(Handle:convar, const String:oldValue[], const String:newValue[]) SM_fTempMulti[0] = StringToFloat(newValue);
public SM_ConVarChanged_TempMulti1(Handle:convar, const String:oldValue[], const String:newValue[]) SM_fTempMulti[1] = StringToFloat(newValue);
public SM_ConVarChanged_TempMulti2(Handle:convar, const String:oldValue[], const String:newValue[]) SM_fTempMulti[2] = StringToFloat(newValue);
public SM_ConVarChanged_TempMulti1(Handle:convar, const String:oldValue[], const String:newValue[])
{
SM_fTempMulti[1] = StringToFloat(newValue);
}

public SM_CVChanged_HealthBonusRatio(Handle:convar, const String:oldValue[], const String:newValue[]) SM_fHBRatio = StringToFloat(newValue);
public SM_CVChanged_SurvivalBonusRatio(Handle:convar, const String:oldValue[], const String:newValue[]) SM_fSurvivalBonusRatio = StringToFloat(newValue);
public SM_ConVarChanged_TempMulti2(Handle:convar, const String:oldValue[], const String:newValue[])
{
SM_fTempMulti[2] = StringToFloat(newValue);
}

public SM_CVChanged_HealthBonusRatio(Handle:convar, const String:oldValue[], const String:newValue[])
{
SM_fHBRatio = StringToFloat(newValue);
}

public SM_CVChanged_SurvivalBonusRatio(Handle:convar, const String:oldValue[], const String:newValue[])
{
SM_fSurvivalBonusRatio = StringToFloat(newValue);
}

public SM_ConVarChanged_Health(Handle:convar, const String:oldValue[], const String:newValue[])
{
Expand Down Expand Up @@ -303,7 +318,10 @@ public Action:SM_FinaleVehicleLeaving_Event(Handle:event, const String:name[], b
SetConVarInt(SM_hSurvivalBonus, SM_CalculateSurvivalBonus());
}

SM_IsPlayerIncap(client) return GetEntProp(client, Prop_Send, "m_isIncapacitated");
bool:SM_IsPlayerIncap(client)
{
return (GetEntProp(client, Prop_Send, "m_isIncapacitated", 1) > 0);
}

public Action:SM_Cmd_Health(client, args)
{
Expand Down
8 changes: 1 addition & 7 deletions addons/sourcemod/scripting/l4d2_skill_detect.sp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
#include <sdktools>
#include <sourcemod>

#define PLUGIN_VERSION "1.1"
#define PLUGIN_VERSION "1.1.1"

#define SHOTGUN_BLAST_TIME 0.1
#define POUNCE_CHECK_TIME 0.1
Expand Down Expand Up @@ -95,12 +95,6 @@
#define ZC_TANK 8
#define HITGROUP_HEAD 1

#define DMG_CRUSH (1 << 0) // crushed by falling or moving object.
#define DMG_BULLET (1 << 1) // shot
#define DMG_SLASH (1 << 2) // cut, clawed, stabbed
#define DMG_CLUB (1 << 7) // crowbar, punch, headbutt
#define DMG_BUCKSHOT (1 << 29) // not quite a bullet. Little, rounder, different.

#define DMGARRAYEXT 7 // MAXPLAYERS+# -- extra indices in witch_dmg_array + 1

#define CUT_SHOVED 1 // smoker got shoved
Expand Down
22 changes: 9 additions & 13 deletions addons/sourcemod/scripting/l4d2_stats.sp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@

#include <sourcemod>
#define L4D2UTIL_STOCKS_ONLY 1
#include <colors>
#include <l4d2util>

#define TEAM_SPECTATOR 1
#define TEAM_SURVIVOR 2
#define TEAM_INFECTED 3
#include <colors>

#define BOOMER_STAGGER_TIME 4.0 // Amount of time after a boomer has been meleed that we consider the meleer the person who
// shut down the boomer, this is just a guess value..
Expand Down Expand Up @@ -45,7 +41,7 @@ public Plugin myinfo =
name = "L4D2 Realtime Stats",
author = "Griffin, Philogl, Sir, A1m`",
description = "Display Skeets/Etc to Chat to clients",
version = "1.2.2",
version = "1.2.3",
url = "https://github.com/SirPlease/L4D2-Competitive-Rework"

}
Expand Down Expand Up @@ -77,7 +73,7 @@ public void Event_PlayerSpawn(Event hEvent, const char[] sEventName, bool bDontB
return;
}

if (GetClientTeam(client) == TEAM_INFECTED)
if (GetClientTeam(client) == TEAM_ZOMBIE)
{
int zombieclass = GetInfectedClass(client);
if (zombieclass == L4D2Infected_Tank)
Expand Down Expand Up @@ -170,7 +166,7 @@ public void Event_AbilityUse(Event hEvent, const char[] sEventName, bool bDontBr
int userid = hEvent.GetInt("userid");
int client = GetClientOfUserId(userid);

if (!IsClientInGame(client) || GetClientTeam(client) != TEAM_INFECTED)
if (!IsClientInGame(client) || GetClientTeam(client) != TEAM_ZOMBIE)
{
return;
}
Expand Down Expand Up @@ -232,7 +228,7 @@ public void Event_PlayerHurt(Event hEvent, const char[] sEventName, bool bDontBr
return;
}

if (GetClientTeam(attacker) == TEAM_SURVIVOR && GetClientTeam(victim) == TEAM_INFECTED)
if (GetClientTeam(attacker) == TEAM_SURVIVOR && GetClientTeam(victim) == TEAM_ZOMBIE)
{
int zombieclass = GetInfectedClass(victim);
if (zombieclass == L4D2Infected_Tank)
Expand Down Expand Up @@ -300,15 +296,15 @@ public void Event_PlayerDeath(Event hEvent, const char[] sEventName, bool bDontB

if (!IsClientInGame(attacker))
{
if (GetClientTeam(victim) == TEAM_INFECTED)
if (GetClientTeam(victim) == TEAM_ZOMBIE)
{
ClearDamage(victim);
}

return;
}

if (GetClientTeam(attacker) == TEAM_SURVIVOR && GetClientTeam(victim) == TEAM_INFECTED)
if (GetClientTeam(attacker) == TEAM_SURVIVOR && GetClientTeam(victim) == TEAM_ZOMBIE)
{
int zombieclass = GetInfectedClass(victim);
if (zombieclass == L4D2Infected_Tank)
Expand Down Expand Up @@ -481,7 +477,7 @@ public void Event_PlayerDeath(Event hEvent, const char[] sEventName, bool bDontB
}
}

if (GetClientTeam(victim) == TEAM_INFECTED)
if (GetClientTeam(victim) == TEAM_ZOMBIE)
{
ClearDamage(victim);
}
Expand Down Expand Up @@ -553,7 +549,7 @@ public void Event_PlayerShoved(Event hEvent, const char[] sEventName, bool bDont
}

int victim = GetClientOfUserId(hEvent.GetInt("userid"));
if (victim == 0 || !IsClientInGame(victim) || GetClientTeam(victim) != TEAM_INFECTED)
if (victim == 0 || !IsClientInGame(victim) || GetClientTeam(victim) != TEAM_ZOMBIE)
{
return;
}
Expand Down
4 changes: 2 additions & 2 deletions addons/sourcemod/scripting/l4d_fix_common_shove.sp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <left4dhooks_anim>
#include <left4dhooks>
#include <actions>

#define PLUGIN_VERSION "1.3"
#define PLUGIN_VERSION "1.3.1"

public Plugin myinfo =
{
Expand Down
4 changes: 2 additions & 2 deletions addons/sourcemod/scripting/l4d_fix_punch_block.sp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
#include <sourcemod>
#include <sourcescramble>
#include <collisionhook>
#include <left4dhooks_lux_library>
#include <left4dhooks>

#define PLUGIN_VERSION "1.2.1"
#define PLUGIN_VERSION "1.2.2"

public Plugin myinfo =
{
Expand Down
2 changes: 0 additions & 2 deletions addons/sourcemod/scripting/left4dhooks_test.sp
Original file line number Diff line number Diff line change
Expand Up @@ -5010,8 +5010,6 @@ public Action L4D2_OnChooseVictim_Pre(int specialInfected, int &lastTarget)
// return Plugin_Changed;

// No target - the special will stand still.
return Plugin_Handled;

return Plugin_Continue;
}

Expand Down
3 changes: 1 addition & 2 deletions addons/sourcemod/scripting/pill_passer.sp
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@
#undef REQUIRE_PLUGIN
#include <l4d2_lagcomp_manager>

#define ENTITY_MAX_NAME_LENGTH 64
#define USE_GIVEPLAYERITEM 0 // Works correctly only in the latest version of sourcemod 1.11 (GivePlayerItem sourcemod native)

public Plugin myinfo =
{
name = "Easier Pill Passer",
author = "CanadaRox, A1m`, Forgetest",
description = "Lets players pass pills and adrenaline with +reload when they are holding one of those items",
version = "1.6.1",
version = "1.6.2",
url = "https://github.com/SirPlease/L4D2-Competitive-Rework"
};

Expand Down
Loading

0 comments on commit d24bbf6

Please sign in to comment.