From 45bf759aa5852a802c20b093f4cc3a1a7147a40b Mon Sep 17 00:00:00 2001 From: Blu3train Date: Tue, 18 Apr 2023 21:38:36 +0200 Subject: [PATCH] more stable character filter --- texthook/engine/engine.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/texthook/engine/engine.cc b/texthook/engine/engine.cc index 4343c35..989d337 100644 --- a/texthook/engine/engine.cc +++ b/texthook/engine/engine.cc @@ -6354,15 +6354,15 @@ static bool InsertYuris2Hook() static bool Yuris3Filter(LPVOID data, DWORD *size, HookParam *, BYTE) { - static bool bEven = false; - static wchar_t even_text; + static wchar_t prev_text; wchar_t* pText = reinterpret_cast(data); - if (bEven = !bEven) - even_text = *pText; - else - if (even_text == *pText) - return false; + if (prev_text == *pText) + { + prev_text = '\0'; + return false; + } + prev_text = *pText; return true; }