Raised This Month: $ Target: $400
 0% 

Question about RegisterHam (wildcard)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 04-15-2016 , 12:02   Re: Question about RegisterHam (wildcard)
Reply With Quote #4

Hamsandwich doesn't really work by entity class, but rather C++ class that entity is linked to.

As an example, if you hooked spawn on "info_target", you would also hook it for "info_player_start" and "info_player_deathmatch" (and possibly few more) as they are all linked to the CPointEntity class.

https://mxr.alliedmods.net/hlsdk/sou...ls/cbase.h#388
https://mxr.alliedmods.net/hlsdk/sou...effects.cpp#32
https://mxr.alliedmods.net/hlsdk/sou...ls/subs.cpp#70

That also explains some confusion I've seen around this forums, there were a few topics asking about why some other entity's virtual functions were hooked when they didn't tell Hamsandwich to hook them.

Well, you can't use wildcards because of what I've said above. Hamsandwich doesn't make classname checks at run-time each time some virtual function is called, it just changes some function pointers around in virtual tables, and each C++ class has its own.
klippy is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:35.


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