mirror of
https://github.com/HaodongMo/ARC-9.git
synced 2025-03-04 03:02:58 -05:00
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:
parent
b6d62865a2
commit
1dead3a3e0
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user