10.07.2012, 13:45
(
Последний раз редактировалось Mauzen; 11.07.2012 в 08:38.
)
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.
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.
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[]);
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.