Srlion
Srlion
So hook.Add gets compiled, also other hook library fails in this test: ``` hook.Add("T", "a", function() print("a") hook.Remove("T", "a") hook.Add("T", "b", function() print("b2") end) end) hook.Add("T", "b", function() print("b") end)...
I'm just showing that mine is more "reliable" and have expected behavior. I don't really know why it prints twice and skips "B" lol
You can test it yourself lol
I think it's only in lua5.1, tested it here https://www.lua.org/demo.html and it works fine.
Tested it on latest [luajit build](https://github.com/LuaJIT/LuaJIT) and lua 5.1.5 and they produce same output, so I guess it won't be fixed.
I could have an array and hashed table to avoid using pairs, but I don’t think it’s worth it? The test thing I’m using made me forget about VARG, maybe...
We can’t just limit it now, would break a lot of addons :s
It would depend on Garrys Mod developers saying yes or no about it (I can’t change the default behavior for anything here :s). Also I don’t know if hook.Run calls...
@ExtReMLapin could you measure hook.Run calls from C++, because calling Lua functions from C++ is heavy, and I don’t know if this would make any difference. (Important for things like...
@DBotThePony Your one fails when you modify/remove: ```lua hook.Add("T", "a", function() print("a") hook.Add("T", "b", function() print("new b") end) end) hook.Add("T", "b", function() print("b") end) hook.Call("T") print("==================") hook.Call("T") ``` Default Lib:...