AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Metamod:Source Questions (https://forums.alliedmods.net/forumdisplay.php?f=74)
-   -   SourceHook - Possible to hook the same member object multiple times? (https://forums.alliedmods.net/showthread.php?t=173421)

Powerlord 12-04-2011 17:20

SourceHook - Possible to hook the same member object multiple times?
 
Background:
I have SH_ADD_HOOK in a method that used to be only called once.

However, in newer versions of my extension, it is now possible to call this function multiple times. Will I be hooking the same event multiple times, or will it just ignore multiple identical hooks on the same object?

API 12-13-2011 15:37

Re: SourceHook - Possible to hook the same member object multiple times?
 
I feel like there would be a new hook every time. One of the nice things about SourceHook is the ability to chain virtual table hooks. I feel like much of that is lost if there is a limitation on hooks per member per plugin.

EDIT: That being said, I'm sure it would be as simple as maintaining a boolean to prevent duplicate hooks on specific members.


All times are GMT -4. The time now is 06:13.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.