fix(hooks): correct logic causing incorrect behavior in return value

Fixed an issue where returning the 'false' value resulted in no output due to the 'or' operator always selecting the second argument. This was due to the way the 'or' operator works, where it prioritizes the first truthy value. The fix ensures the correct value is returned in cases where the 'false' value should be considered.
This commit is contained in:
Melow 2025-02-28 00:11:09 +02:00
parent b6d62865a2
commit 1dead3a3e0

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