Ghostcode after ALS hooking
#1

Somehow a hooked callback turned into ghostcode. No matter how I change the hooked function, it doesnt have any effect, even if i completely remove it. The printf output still remains the same. Im sure that im not editing the wrong file, or forgot about another file with the same hooked function. The other functions in the include containing the hooked function change fine if i edit them.
Is this somehow a known problem? I didnt find anything about it.

This is the hooked function. The original callback is just a usual OnPlayerCommandText with some strcmp commands. There are no other hooks for this function.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[]) {
    if (!IsPlayerNPC(playerid)) return CallLocalFunction("RNPC_OnPlayerCommandText", "is", playerid, cmdtext);
   
    #if defined RNPC_DEBUG
        printf("RNPCf %d: [CMD] %s", playerid, cmdtext);
    #endif
   
    if (!strcmp("RNPC:002", cmdtext, true, 8)) {
        CallLocalFunction("OnRNPCPlaybackFinished", "i", playerid);
    }
   
    CallLocalFunction("RNPC_OnPlayerCommandText", "is", playerid, cmdtext);
    return true;
}
#if defined _ALS_OnPlayerCommandText
    #undef OnPlayerCommandText
#else
    #define _ALS_OnPlayerCommandText
#endif
#define OnPlayerCommandText RNPC_OnPlayerCommandText
forward RNPC_OnPlayerCommandText(playerid, cmdtext[]);
Im out of ideas, as the code seems just to appear out of nowhere on compiling. No idea where the compiler reads it from.

Edit: The problem was a filterscript hooking OnPlayerCommandText with an old version of the include. The filterscript stopped forwarding of commands to the gamemode, and so just the old output appeared.
Reply
#2

pawn Код:
#if defined _ALS_OnPlayerCommandText
    #undef OnPlayerCommandText
#else
    #define _ALS_OnPlayerCommandText
    #undef OnPlayerCommandText
#endif
EDIT: Just my guess.
Reply
#3

The hooking defines shouldnt be the problem, its the normal code, and i got several other hooked callbacks that work the same way.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)