Closed doomy64 closed 4 years ago
Egh. While this should work, there edge cases that two eureka teleports can happen at same time, and potentially another IsPlayerClass
called in the same frame. I would've better off make new virtual client hook CBasePlayer::ClientCommand
, disallow IsPlayerClass
at post hook while keeping AddCommandListener
as pre hook.
Updated to disallow IsPlayerClass
in a CTFPlayer::ClientCommand
post hook, rather than next frame. As far as I can tell this works.
If I knew more about dhooks I probably would've checked to if the command was eureka_teleport
in the post hook, that way I could use g_iAllowClientClass
instead of creating a new variable.
Fixes #48 Add a listener for the player command "eureka_teleport". Have
IsPlayerClass
always return true when using this command. There isn't another event that fires every time this command is called, which is why we don't useg_iAllowClientClass
and why we reset the new variable the frame after running.