void __fastcall C_Hooks::pFnAccept(void* _this, int edx, IRecipientFilter& filter, int iEntIndex, int iChannel, const char* pSoundEntry, unsigned int nSoundEntryHash, const char* pSample, float flVolume, int nSeed, float flAttenuation, int iFlags, int iPitch, const Vector* pOrigin, const Vector* pDirection, void* pUtlVecOrigins, bool bUpdatePositions, float soundtime, int speakerentity, int unk)
{
if (g_Settings->m_AutoAccept)
{
if (!strcmp(pSoundEntry, "UIPanorama.popup_accept_match_beep")) {
static auto fnAccept = reinterpret_cast<bool(__stdcall*)(const char*)>(g_Globals.m_Hooks.m_Originals.pFnAccept);
if (fnAccept) {
fnAccept("");
static HWND window = FindWindow(NULL, "Counter-Strike: Global Offensive");
//static HWND window = FindWindow(NULL, "Counter-Strike: Global Offensive - Direct3D 9");
//This will flash the CSGO window on the taskbar
//so we know a game was found (you cant hear the beep sometimes cause it auto-accepts too fast)
FLASHWINFO fi;
fi.cbSize = sizeof(FLASHWINFO);
fi.hwnd = window;
fi.dwFlags = FLASHW_ALL | FLASHW_TIMERNOFG;
fi.uCount = 0;
fi.dwTimeout = 0;
FlashWindowEx(&fi);
}
}
}
return g_Globals.m_Hooks.m_Originals.pFnAccept(_this, edx, filter, iEntIndex, iChannel, pSoundEntry, nSoundEntryHash, pSample, flVolume, nSeed, flAttenuation, iFlags, iPitch, pOrigin, pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity, unk);
}