Skip to content

Commit c048ca7

Browse files
authored
Updated plugins. (#411)
1) Fix the build of plugins for the latest version of the sourcemod (fixed errors and warnings). 2) Updated syntax in some plugins. 3) Added latest version of 'left4dhooks'. 4) 'l4d2_tank_damage_cvars' fixed broken functionality related to cvar 'vs_tank_pound_damage' (apparently this code never worked). 5) 'l4d2_sniper_bodyshot' code optimization. 6) Added smac include for plugin build l4d2_user_commands'. 7) Removed conversions to another datatype in many plugins due to enum. 8) Removed unnecessary checks in some plugins. 9) Changed l4d2util includes. Since we only use enum as constants, the enumeration names have been removed. the name made it clear to the compiler that we were using our own datatype, so we had to convert it to another datatype to avoid the warnings. 10)
1 parent ae4ac2d commit c048ca7

119 files changed

Lines changed: 6642 additions & 3450 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

addons/sourcemod/gamedata/left4dhooks.l4d2.txt

Lines changed: 715 additions & 257 deletions
Large diffs are not rendered by default.
24 Bytes
Binary file not shown.
5.68 KB
Binary file not shown.
-1 Bytes
Binary file not shown.
2.2 KB
Binary file not shown.
144 Bytes
Binary file not shown.
2.39 KB
Binary file not shown.
232 Bytes
Binary file not shown.

addons/sourcemod/scripting/1v1.sp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,18 @@ public void Event_PlayerHurt(Event hEvent, const char[] sEventName, bool bDontBr
5454
}
5555

5656
int iAttacker = GetClientOfUserId(hEvent.GetInt("attacker"));
57-
if (!IsClientAndInGame(iAttacker) || GetClientTeam(iAttacker) != view_as<int>(L4D2Team_Infected)) {
57+
if (!IsClientAndInGame(iAttacker) || GetClientTeam(iAttacker) != L4D2Team_Infected) {
5858
return;
5959
}
6060

6161
int iZclass = GetEntProp(iAttacker, Prop_Send, "m_zombieClass");
6262

63-
if (iZclass < view_as<int>(L4D2Infected_Smoker) || iZclass > view_as<int>(L4D2Infected_Charger)) {
63+
if (iZclass < L4D2Infected_Smoker || iZclass > L4D2Infected_Charger) {
6464
return;
6565
}
6666

6767
int iVictim = GetClientOfUserId(hEvent.GetInt("userid"));
68-
if (!IsClientAndInGame(iVictim) || GetClientTeam(iVictim) != view_as<int>(L4D2Team_Survivor)) {
68+
if (!IsClientAndInGame(iVictim) || GetClientTeam(iVictim) != L4D2Team_Survivor) {
6969
return;
7070
}
7171

addons/sourcemod/scripting/TickrateFixes.sp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#define ENTITY_MAX_NAME 64
3333

3434
//Tracking
35-
enum DoorsTypeTracked
35+
enum /*DoorsTypeTracked*/
3636
{
3737
DoorsTypeTracked_None = -1,
3838
DoorsTypeTracked_Prop_Door_Rotating = 0,
@@ -48,7 +48,7 @@ static const char g_szDoors_Type_Tracked[][MAX_NAME_LENGTH] =
4848
#if SOURCEMOD_V_MINOR > 9
4949
enum struct DoorsData
5050
{
51-
DoorsTypeTracked DoorsData_Type;
51+
int DoorsData_Type;
5252
float DoorsData_Speed;
5353
bool DoorsData_ForceClose;
5454
}
@@ -59,7 +59,7 @@ DoorsData
5959
#else
6060
enum DoorsData
6161
{
62-
DoorsTypeTracked:DoorsData_Type,
62+
DoorsData_Type,
6363
Float:DoorsData_Speed,
6464
bool:DoorsData_ForceClose
6565
};
@@ -175,7 +175,7 @@ public void Hook_DoorSpawnPost(int iEntity)
175175
// Save Original Settings.
176176
for (int i = 0; i < sizeof(g_szDoors_Type_Tracked); i++) {
177177
if (strcmp(sClassName, g_szDoors_Type_Tracked[i], false) == 0) {
178-
Door_GetSettings(iEntity, view_as<DoorsTypeTracked>(i));
178+
Door_GetSettings(iEntity, i);
179179
}
180180
}
181181

@@ -343,14 +343,14 @@ void Door_GetSettingsAll()
343343

344344
for (int i = 0;i < sizeof(g_szDoors_Type_Tracked); i++) {
345345
while ((iEntity = FindEntityByClassname(iEntity, g_szDoors_Type_Tracked[i])) != INVALID_ENT_REFERENCE) {
346-
Door_GetSettings(iEntity, view_as<DoorsTypeTracked>(i));
346+
Door_GetSettings(iEntity, i);
347347
}
348348

349349
iEntity = -1;
350350
}
351351
}
352352

353-
void Door_GetSettings(int iEntity, DoorsTypeTracked iDoorType)
353+
void Door_GetSettings(int iEntity, int iDoorType)
354354
{
355355
#if SOURCEMOD_V_MINOR > 9
356356
g_ddDoors[iEntity].DoorsData_Type = iDoorType;

0 commit comments

Comments
 (0)