Merge pull request #270 from MelowFX/main

fix(hooks): correct logic causing incorrect behavior in return value
This commit is contained in:
Darsu 2025-02-28 12:54:18 +07:00 committed by GitHub
commit 027b4296ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View File

@ -192,7 +192,10 @@ do
any = true
end
data = hook.Run("ARC9_" .. val, self, data) or data
data2 = hook.Run("ARC9_" .. val, self, data)
if data2 ~= nil then
data = data2
end
return data, any
end
@ -229,7 +232,10 @@ do
end
self.HookCache[val] = newCache
data = hook.Run("ARC9_" .. val, self, data) or data
data2 = hook.Run("ARC9_" .. val, self, data)
if data2 ~= nil then
data = data2
end
return data, any
end

View File

@ -602,6 +602,8 @@ function SWEP:CanDetach(addr)
if slottbl and slottbl.Integral then return false end
if self:RunHook("Hook_CanDetachAttachment", {addr = addr, slottbl = slottbl}) == false then return false end
return true
end