I'm still figuring out this. added va_list, but still crash. and buffer prints obstruction string.
Code:
DETOUR_DECL_MEMBER2(PrintIfWatched, void, char *, format, va_list *, args)
{
CBaseEntity *pBot = (CBaseEntity *)this;
size_t len;
va_list ap;
char buffer[1024];
va_start(ap, format);
vsprintf(buffer, format, ap);
va_end(ap);
g_SMAPI->ConPrintf("buffer : %s\n", buffer);
cell_t result = g_BotController.OnPrintIfWatched(pBot, buffer);
if (result == Pl_Handled || result == Pl_Stop)
return;
g_SMAPI->ConPrintf("Calling..\n");
DETOUR_MEMBER_CALL(PrintIfWatched)(format, args);
}