Wanted to share a puzzle that you guys might want to look at if you have some spare time.
My code (that was working properly before) recently started crashing, and I can't figure out what has changed - yes, I'm this bad.
Somehow the crash is related to the pre-hooks, because if I remove the prehook, the crash doesn't happen.
Because I'm too lazy to download a SRCDS again and am doing all my tests on a listen server, it's difficult to check if there're any exceptions raised - the game just closes itself.
What I did is put host_timescale 0.05, triggered the chain of events that would lead to crash (threw a grenade) and started waiting the crash (grenade detonation) with the opened console, ready to take a screenshot.
This.
What's funny, the game did not crash.
But the exception... I personally do not have any method called _execute, but SP does. It belongs to TickRepeat class from listeners/tick.py. And this method is only referenced in several places
Code: Select all
# Start the delay
self._delay = Delay(self._interval, self._execute)
Code: Select all
# Start the delay
self._delay = Delay(self._loop_time, self._execute)
Code: Select all
# Call the delay again
self._delay = Delay(self._interval, self._execute)
That's it, it's only called from withing a Delay, which is created without any arguments to pass to ._execute. So 'self' is the first positional argument obviously, but where could another, unexpected one come from?
And the fact that there's basically no traceback to this exception doesn't make things easier. Most probably it indeed belongs to tick listener system.