Skip to content

Commit d48bcc9

Browse files
authored
Merge pull request darkerz7#71 from Rushaway/clean
fix(dz75): Remove un-used params
2 parents 2d77bfe + ecbfbb9 commit d48bcc9

4 files changed

Lines changed: 11 additions & 50 deletions

File tree

addons/sourcemod/scripting/entwatch/module_hud.inc

Lines changed: 7 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
ConVar g_hCvar_DisplayEnabled,
1111
g_hCvar_DisplayCooldowns,
1212
g_hCvar_Admins_See,
13-
g_hCvar_HUD_Channel,
1413
g_hCvar_ZM_pry,
1514
g_hCvar_MaxHudItemsCount,
1615
g_hCvar_HudRotationDefault;
@@ -26,11 +25,8 @@ bool g_bDispEnabled = true,
2625
g_bDispCooldowns = true,
2726
g_bAdminsSee = true,
2827
g_bZombieNoItemPry = false;
29-
bPluginDynamic = false,
30-
bNative_Dynamic = false,
3128
bNative_MsgTypeProtobuf = false;
3229

33-
int g_iHUDChannel = 5;
3430
int g_iDefaultRotationTime = 3;
3531
int g_iMaxItemsCount = 10;
3632

@@ -47,15 +43,13 @@ stock void EWM_Hud_OnPluginStart()
4743
g_hCvar_DisplayEnabled = CreateConVar("entwatch_display_enable", "1", "Enable/Disable the display.", _, true, 0.0, true, 1.0);
4844
g_hCvar_DisplayCooldowns = CreateConVar("entwatch_display_cooldowns", "1", "Show/Hide the cooldowns on the display.", _, true, 0.0, true, 1.0);
4945
g_hCvar_Admins_See = CreateConVar("entwatch_admins_see", "1", "Enable/Disable admins see everything Items", _, true, 0.0, true, 1.0);
50-
g_hCvar_HUD_Channel = CreateConVar("entwatch_hud_channel", "5", "Change HUD Channel/Group Dynamic channel.", _, true, 0.0, true, 5.0);
5146
g_hCvar_ZM_pry = CreateConVar("entwatch_zm_noitem_pry", "0", "Enable/Disable zm pry human Items if zms without items", _, true, 0.0, true, 1.0);
5247
g_hCvar_MaxHudItemsCount = CreateConVar("entwatch_hud_items_count", "10", "Max/Default Items Count in hud to display.", _, true, 1.0, true, 10.0);
5348
g_hCvar_HudRotationDefault = CreateConVar("entwatch_hud_rotation_time_default", "3", "Default Rotation time in seconds for hud.", _, true, 1.0, true, 5.0);
5449

5550
g_bDispEnabled = GetConVarBool(g_hCvar_DisplayEnabled);
5651
g_bDispCooldowns = GetConVarBool(g_hCvar_DisplayCooldowns);
5752
g_bAdminsSee = GetConVarBool(g_hCvar_Admins_See);
58-
g_iHUDChannel = GetConVarInt(g_hCvar_HUD_Channel);
5953
g_bZombieNoItemPry = GetConVarBool(g_hCvar_ZM_pry);
6054

6155
RegConsoleCmd("sm_hud", EWM_Hud_Command_ToggleHUD);
@@ -66,7 +60,6 @@ stock void EWM_Hud_OnPluginStart()
6660
HookConVarChange(g_hCvar_DisplayEnabled, Cvar_HUD_Changed);
6761
HookConVarChange(g_hCvar_DisplayCooldowns, Cvar_HUD_Changed);
6862
HookConVarChange(g_hCvar_Admins_See, Cvar_HUD_Changed);
69-
HookConVarChange(g_hCvar_HUD_Channel, Cvar_HUD_Changed);
7063
HookConVarChange(g_hCvar_ZM_pry, Cvar_HUD_Changed);
7164
HookConVarChange(g_hCvar_MaxHudItemsCount, Cvar_HUD_Changed);
7265
HookConVarChange(g_hCvar_HudRotationDefault, Cvar_HUD_Changed);
@@ -89,8 +82,6 @@ public void Cvar_HUD_Changed(ConVar convar, const char[] oldValue, const char[]
8982
g_bDispCooldowns = GetConVarBool(convar);
9083
else if(convar==g_hCvar_Admins_See)
9184
g_bAdminsSee = GetConVarBool(convar);
92-
else if(convar==g_hCvar_HUD_Channel)
93-
g_iHUDChannel = GetConVarInt(convar);
9485
else if(convar==g_hCvar_ZM_pry)
9586
g_bZombieNoItemPry = GetConVarBool(convar);
9687
else if(convar==g_hCvar_MaxHudItemsCount)
@@ -113,33 +104,19 @@ public void EWM_Hud_OnAllPluginsLoaded()
113104

114105
public void EWM_Hud_OnLibraryRemoved(const char[] name)
115106
{
116-
if (strcmp(name, "DynamicChannels", false) == 0)
117-
{
118-
bPluginDynamic = false;
119-
VerifyNatives_DynamicChannels();
120-
}
107+
// Nothing yet
121108
}
122109

123110
public void EWM_Hud_OnLibraryAdded(const char[] name)
124111
{
125-
if (strcmp(name, "DynamicChannels", false) == 0)
126-
{
127-
bPluginDynamic = true;
128-
VerifyNatives_DynamicChannels();
129-
}
112+
// Nothing yet
130113
}
131114

132115
stock VerifyNatives()
133116
{
134-
VerifyNatives_DynamicChannels();
135117
VerifyNative_MessageTypeProtobuf();
136118
}
137119

138-
stock void VerifyNatives_DynamicChannels()
139-
{
140-
bNative_Dynamic = bPluginDynamic && CanTestFeatures() && GetFeatureStatus(FeatureType_Native, "GetDynamicChannel") == FeatureStatus_Available;
141-
}
142-
143120
stock void VerifyNative_MessageTypeProtobuf()
144121
{
145122
bNative_MsgTypeProtobuf = CanTestFeatures() && GetFeatureStatus(FeatureType_Native, "GetUserMessageType") == FeatureStatus_Available && GetUserMessageType() == UM_Protobuf;
@@ -232,13 +209,8 @@ public void EWM_Hud_OnMapStart()
232209
}
233210
}
234211

235-
public void EWM_Hud_DisplayCustomHUD(int client, int iHUDChannel, const char[] sMes_Names, const char[] sMes_NoNames)
212+
public void EWM_Hud_DisplayCustomHUD(int client, const char[] sMes_Names, const char[] sMes_NoNames)
236213
{
237-
#if defined _DynamicChannels_included_
238-
if (bNative_Dynamic)
239-
iHUDChannel = GetDynamicChannel(iHUDChannel);
240-
#endif
241-
242214
char msg[MAX_KeyHintText];
243215
if (g_CSettings_Hud[client].Name)
244216
Format(msg, sizeof(msg), "%s", sMes_Names);
@@ -334,13 +306,13 @@ public Action EWM_Hud_Timer_DisplayHUD(Handle timer, int client)
334306
bool bShowZombiesHUD = (iCountZMItems > 0) && (g_bTeamOnly && iTeam == CS_TEAM_T);
335307

336308
if (bIsAdmin)
337-
EWM_Hud_DisplayCustomHUD(i, g_iHUDChannel, sMes_Admins, sMes_Admins_woname);
309+
EWM_Hud_DisplayCustomHUD(i, sMes_Admins, sMes_Admins_woname);
338310
else if (bShowHumansHUD)
339-
EWM_Hud_DisplayCustomHUD(i, g_iHUDChannel, sMes_Humans, sMes_Humans_woname);
311+
EWM_Hud_DisplayCustomHUD(i, sMes_Humans, sMes_Humans_woname);
340312
else if (bShowZombiesHUD)
341-
EWM_Hud_DisplayCustomHUD(i, g_iHUDChannel, sMes_Zombies, sMes_Zombies_woname);
313+
EWM_Hud_DisplayCustomHUD(i, sMes_Zombies, sMes_Zombies_woname);
342314
else
343-
EWM_Hud_DisplayCustomHUD(i, g_iHUDChannel, sMes_Admins, sMes_Admins_woname);
315+
EWM_Hud_DisplayCustomHUD(i, sMes_Admins, sMes_Admins_woname);
344316
}
345317
}
346318

addons/sourcemod/scripting/entwatch_dz.sp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ char g_sSteamIDs_short[MAXPLAYERS+1][32];
4747
int g_iUserIDs[MAXPLAYERS+1];
4848
int g_iClientEbansNumber[MAXPLAYERS+1] = {0,... };
4949

50-
#undef REQUIRE_PLUGIN
51-
#tryinclude <DynamicChannels> // https://github.com/Vauff/DynamicChannels
52-
#define REQUIRE_PLUGIN
53-
5450
//Modules can be included as you wish. To do this, comment out or uncomment the corresponding module
5551
#include "entwatch/module_forwards.inc" //For the include EntWatch.inc to work correctly, use with module_eban and module_database
5652
#include "entwatch/module_chat.inc"
@@ -1444,7 +1440,7 @@ public void Event_OutValue(const char[] sOutput, int iCaller, int iActivator, fl
14441440
//-------------------------------------------------------
14451441
public Action Event_GameUI_LeftClick(const char[] sOutput, int iCaller, int iActivator, float Delay)
14461442
{
1447-
OnGameUIUse(iCaller, iActivator, false);
1443+
OnGameUIUse(iActivator, false);
14481444
return Plugin_Continue;
14491445
}
14501446

@@ -1453,7 +1449,7 @@ public Action Event_GameUI_LeftClick(const char[] sOutput, int iCaller, int iAct
14531449
//-------------------------------------------------------
14541450
public Action Event_GameUI_RightClick(const char[] sOutput, int iCaller, int iActivator, float Delay)
14551451
{
1456-
OnGameUIUse(iCaller, iActivator, true);
1452+
OnGameUIUse(iActivator, true);
14571453
return Plugin_Continue;
14581454
}
14591455

@@ -1595,7 +1591,7 @@ stock void Events_OnUseItem(class_ItemList ItemTest,int iActivator, int iAbility
15951591
// Note: PressedAttack2 is true when the right mouse button is pressed
15961592
// Note: If the HammerID used for "game_ui" is the same for Left and Right click (shared "game_ui"), the PressedAttack2 will be true
15971593
// Note: That mean PressedAttack2 will be "buttonid2, mode2, etc"
1598-
stock void OnGameUIUse(int iCaller, int iActivator, bool PressedAttack2 = false)
1594+
stock void OnGameUIUse(int iActivator, bool PressedAttack2 = false)
15991595
{
16001596
if(!g_bConfigLoaded) return;
16011597

addons/sourcemod/scripting/include/EntWatch.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#define _EntWatch_include
55

66
#define EW_V_MAJOR "3"
7-
#define EW_V_MINOR "74"
7+
#define EW_V_MINOR "75"
88

99
#define EW_VERSION EW_V_MAJOR...".DZ."...EW_V_MINOR
1010

sourceknight.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,6 @@ project:
1717
- source: /addons/sourcemod/scripting/include
1818
dest: /addons/sourcemod/scripting/include
1919

20-
- name: dynamicchannels
21-
type: git
22-
repo: https://github.com/Vauff/DynamicChannels
23-
unpack:
24-
- source: /scripting/include
25-
dest: /addons/sourcemod/scripting/include
26-
2720
- name: discordwebhookapi
2821
type: git
2922
repo: https://github.com/Sarrus1/DiscordWebhookAPI

0 commit comments

Comments
 (0)