From 96f65b0e58e55bfa2fef83a330842d38923fe4d3 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Fri, 6 Nov 2026 07:20:41 +0000 Subject: [PATCH] Decompile 3 functions in Source/Client/Input/Language.cpp Batch #13146 by cremane: 0 byte-identical, 3 confirmed by peer review. - fn_17766 CLanguageBase::MoveBack: logic confirmed by peer review - fn_17787 CLanguageBase::MoveForward: logic confirmed by peer review - fn_17792 CLanguageBase::KeyDown: logic confirmed by peer review (already on main) Peer-reviewed-by: gordaoprogramas, codeplay, StrawberrysherbetIX Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Client/Input/Language.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Source/Client/Input/Language.cpp b/Source/Client/Input/Language.cpp index 99cd55f8..4e1e9f23 100644 --- a/Source/Client/Input/Language.cpp +++ b/Source/Client/Input/Language.cpp @@ -182,11 +182,13 @@ void CLanguageBase::Paste() { // OFFSET: 0x00ACD6B0 // FUNCTION: fn_17766 void CLanguageBase::MoveBack() { - if (this->cursor < 0) { - this->cursor = 0; - } else if (this->cursor != 0) { - const char* begin = this->text.c_str(); - this->cursor = static_cast(CharPrevExA(static_cast(this->codePage), begin, begin + this->cursor, 0) - begin); + if (this->cursor != 0) { + if (this->cursor < 0) { + this->cursor = 0; + } else { + const char* begin = this->text.c_str(); + this->cursor = static_cast(CharPrevExA(static_cast(this->codePage), begin, begin + this->cursor, 0) - begin); + } } } // OFFSET: 0x00ACE440 @@ -213,12 +215,12 @@ void CLanguageBase::MoveForward() { if (position == length) { return; } - if (position < length) { - const char* begin = this->text.c_str(); - this->cursor = static_cast(CharNextExA(static_cast(this->codePage), begin + position, 0) - begin); + if (position > length) { + this->cursor = static_cast(length); return; } - this->cursor = static_cast(length); + const char* begin = this->text.c_str(); + this->cursor = static_cast(CharNextExA(static_cast(this->codePage), begin + position, 0) - begin); } // OFFSET: 0x00ACE5E0 // FUNCTION: fn_17789