Raised This Month: $134 Target: $400
 33% 

[CSS] Detour template class function


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kadet.89
Senior Member
Join Date: Nov 2012
Old 10-07-2017 , 10:16   [CSS] Detour template class function
Reply With Quote #1

I'm trying to detour this function:

PHP Code:
bool CBot<CCSPlayer>::IsPlayerLookingAtMe(CBasePlayer *, float) const 
Linux signature:
PHP Code:
_ZNK4CBotI9CCSPlayerE19IsPlayerLookingAtMeEP11CBasePlayerf 
I get this gamedata:
PHP Code:
            "CBot_CCSPlayer::IsPlayerLookingAtMe"
            
{
                
"library"        "server"
                "linux"            "@_ZNK4CBotI9CCSPlayerE19IsPlayerLookingAtMeEP11CBasePlayerf"
            

PHP Code:
DETOUR_DECL_MEMBER2(IsPlayerLookingAtMeboolCBasePlayer *, playerfloatepsilon)
{
    return 
DETOUR_MEMBER_CALL(IsPlayerLookingAtMe)(playerepsilon);
}
bool CreateIsPlayerLookingAtMeDetour()
{
    
DIsPlayerLookingAtMe =  DETOUR_CREATE_MEMBER(IsPlayerLookingAtMe"CBot_CCSPlayer::IsPlayerLookingAtMe");

    if(
DIsPlayerLookingAtMe != NULL)
    {
        
DIsPlayerLookingAtMe->EnableDetour();
        return 
true;
    }
    
g_pSM->LogError(myself"CBot<CCSPlayer>::IsPlayerLookingAtMe detour could not be initialized");
    return 
false;

After calling CreateIsPlayerLookingAtMeDetour I get this message:
"CBot<CCSPlayer>::IsPlayerLookingAtMe detour could not be initialized" and the detour doesn't work. I compared this function with the other i've detoured and the only difference is that it's class is a template class... Any ideas ?
kadet.89 is offline
Send a message via Skype™ to kadet.89
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 13:23.


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