Skip to content

Commit 47990e1

Browse files
GrocelSligWolf
andcommitted
Fixed "3DStreamRadio_UrlIsAllowed" hook not being called.
Co-Authored-By: SligWolf <[email protected]>
1 parent 08a75b5 commit 47990e1

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
447
2-
1731972171
1+
448
2+
1732383526

lua/streamradio_core/hook.lua

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ local LIB = StreamRadioLib.Hook
66
table.Empty(LIB)
77

88
local g_namePrefixMain = "3DStreamRadio_mainHook_"
9-
local g_nameprefixCustom = "3DStreamRadio_"
9+
local g_namePrefixCustom = "3DStreamRadio_"
1010
local g_hooks = {}
1111
local g_orderCounter = 0
1212

13-
function LIB.GetMainHookIdentifier(eventName)
13+
local function getMainHookIdentifier(eventName)
1414
local identifier = g_namePrefixMain .. tostring(eventName or "")
1515
return identifier
1616
end
1717

18-
function LIB.GetCostomHookIdentifier(eventName)
19-
local identifier = g_nameprefixCustom .. tostring(eventName or "")
18+
local function getCustomHookIdentifier(eventName)
19+
local identifier = g_namePrefixCustom .. tostring(eventName or "")
2020
return identifier
2121
end
2222

@@ -140,7 +140,7 @@ function LIB.Add(eventName, identifier, func, order)
140140
BuildOrder(hookData)
141141

142142
if not hookData.hasHook then
143-
local hookIdentifier = LIB.GetMainHookIdentifier(eventName)
143+
local hookIdentifier = getMainHookIdentifier(eventName)
144144

145145
hook.Remove(eventName, hookIdentifier)
146146
hook.Add(eventName, hookIdentifier, function(...)
@@ -170,7 +170,7 @@ function LIB.Remove(eventName, identifier)
170170
BuildOrder(hookData)
171171

172172
if table.IsEmpty(byName) then
173-
local hookIdentifier = LIB.GetMainHookIdentifier(eventName)
173+
local hookIdentifier = getMainHookIdentifier(eventName)
174174

175175
hook.Remove(eventName, hookIdentifier)
176176
hookData.hasHook = nil
@@ -183,17 +183,17 @@ function LIB.Run(eventName, ...)
183183
end
184184

185185
function LIB.AddCustom(eventName, ...)
186-
local eventName = LIB.GetMainHookIdentifier(eventName)
186+
local eventName = getCustomHookIdentifier(eventName)
187187
return LIB.Add(eventName, ...)
188188
end
189189

190190
function LIB.RemoveCustom(eventName, ...)
191-
local eventName = LIB.GetMainHookIdentifier(eventName)
191+
local eventName = getCustomHookIdentifier(eventName)
192192
return LIB.Remove(eventName, ...)
193193
end
194194

195195
function LIB.RunCustom(eventName, ...)
196-
local eventName = LIB.GetMainHookIdentifier(eventName)
196+
local eventName = getCustomHookIdentifier(eventName)
197197
return LIB.Run(eventName, ...)
198198
end
199199

0 commit comments

Comments
 (0)