Raised This Month: $ Target: $400
 0% 

register_think in fakemeta


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
commonbullet
Veteran Member
Join Date: Oct 2005
Old 10-21-2006 , 23:37   register_think in fakemeta
Reply With Quote #1

I suppose that hooking prethink forward and checking classname is not a good way to make it.. If engine’s register_think is better designed (I don’t know), is there a way to hook an entity think by classname that same way in fakemeta?

Last edited by commonbullet; 10-21-2006 at 23:43.
commonbullet is offline
Send a message via ICQ to commonbullet Send a message via MSN to commonbullet
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 10-21-2006 , 23:55   Re: register_think in fakemeta
Reply With Quote #2

Code:
register_forward(FM_Think, "_FM_Think"); public _FM_Think(ent) {     static class[32];     pev(ent, pev_classname, class, 31);     if(equal("One Your checking", class))     {         // Do stuff     } }

Or if you know the ent index and the ent going to be there for awhile. Then I would just store the ent index and compare it.
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
commonbullet
Veteran Member
Join Date: Oct 2005
Old 10-22-2006 , 00:13   Re: register_think in fakemeta
Reply With Quote #3

Yep, I was trying to avoid checking classname because it envolves some extra processing; copying pev->classname into a string, and comparing... But since I need to do that with few entities, I'm may check the indexes instead.

Thank you.
commonbullet is offline
Send a message via ICQ to commonbullet Send a message via MSN to commonbullet
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 10-22-2006 , 00:26   Re: register_think in fakemeta
Reply With Quote #4

Engine does it the same way: on entity think, look through list of classnames registered for think, and if this entity's classname matches, call that forward.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Reply


Thread Tools
Display Modes

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 04:56.


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