Skip to content

Commit 0b5521e

Browse files
committed
Revert "Fix base hooks being unsubscribed from"
This reverts commit 045239a.
1 parent fe3c957 commit 0b5521e

File tree

4 files changed

+3
-26
lines changed

4 files changed

+3
-26
lines changed

src/Oxide.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Project>
33
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
44
<Import Project="..\netfx.props" />

src/Plugins/CSPlugin.cs

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Oxide.Core.Libraries;
1+
using Oxide.Core.Libraries;
22
using System;
33
using System.Collections.Generic;
44
using System.Reflection;
@@ -115,27 +115,6 @@ protected void AddHookMethod(string name, MethodInfo method)
115115
hookMethods.Add(new HookMethod(method));
116116
}
117117

118-
internal override bool IsBaseHook(string name)
119-
{
120-
if (string.IsNullOrEmpty(name))
121-
{
122-
return false;
123-
}
124-
125-
if (Hooks.TryGetValue(name, out List<HookMethod> hooks))
126-
{
127-
for (int i = 0; i < hooks.Count; i++)
128-
{
129-
if (hooks[i].IsBaseHook)
130-
{
131-
return true;
132-
}
133-
}
134-
}
135-
136-
return false;
137-
}
138-
139118
/// <summary>
140119
/// Calls the specified hook on this plugin
141120
/// </summary>

src/Plugins/Plugin.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,6 @@ public object CallHook(string hook, params object[] args)
327327
/// <returns></returns>
328328
protected abstract object OnCallHook(string hook, object[] args);
329329

330-
internal virtual bool IsBaseHook(string name) => false;
331-
332330
/// <summary>
333331
/// Raises an error on this plugin
334332
/// </summary>

src/Plugins/PluginManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ internal void SubscribeToHook(string hook, Plugin plugin)
144144
/// <param name="plugin"></param>
145145
internal void UnsubscribeToHook(string hook, Plugin plugin)
146146
{
147-
if (!loadedPlugins.ContainsKey(plugin.Name) || !plugin.IsCorePlugin && (hook.StartsWith("IOn") || hook.StartsWith("ICan")) || plugin.IsBaseHook(hook))
147+
if (!loadedPlugins.ContainsKey(plugin.Name) || !plugin.IsCorePlugin && (hook.StartsWith("IOn") || hook.StartsWith("ICan")))
148148
{
149149
return;
150150
}

0 commit comments

Comments
 (0)