AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Coding MM:S Plugins & SM Extensions (https://forums.alliedmods.net/forumdisplay.php?f=75)
-   -   [CSS] Detour template class function (https://forums.alliedmods.net/showthread.php?t=301858)

kadet.89 10-07-2017 09:16

[CSS] Detour template class function
 
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 ?:grrr:


All times are GMT -4. The time now is 09:26.

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