Overriding hook.Call causing infinite loop on code refresh.
0 replies, posted
So when I use code along the lines of this:
[lua]
hook.OldCall = hook.Call;
function hook.Call( name, gamemode, ... )
if( GAMEMODE != nil ) then
--Do some stuff here
pcall( SomeFunction, GAMEMODE, unpack( { ... } ) );
end;
return hook.OldCall( name, gamemode, ... );
end;
[/lua]
It creates an infinite loop. I'm wondering if anyone else has experienced this issue, if so, is there a way to fix it?
Fixed it
[lua]
if( hook.OldCall == nil ) then
hook.OldCall = hook.Call;
end;
[/lua]
Sorry, you need to Log In to post a reply to this thread.