From 241c913563bb0baf212ca7d0c115e98d0eb07853 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Wed, 28 Oct 2026 11:01:42 +0000 Subject: [PATCH] Decompile fn_17790 (TextInputBuffer::RetreatCursor) Batch #1343 by ragnarok-clanker: 0 byte-identical, 1 confirmed by peer review. - fn_17790 TextInputBuffer::RetreatCursor: logic confirmed by peer review Peer-reviewed-by: eAthena Reviewed-by: ragnarok-clanker --- Source/Client/Input/TextInputBuffer.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Source/Client/Input/TextInputBuffer.cpp b/Source/Client/Input/TextInputBuffer.cpp index 9df1121d..55ca7baa 100644 --- a/Source/Client/Input/TextInputBuffer.cpp +++ b/Source/Client/Input/TextInputBuffer.cpp @@ -210,6 +210,23 @@ void TextInputBuffer::MoveForward(unsigned codePage) { // OFFSET: 0x00ACE5E0 // OFFSET: 0x00ACE620 +// FUNCTION: fn_17790 +void TextInputBuffer::RetreatCursor(int delta) { + if (this->cursor == 0) { + return; + } + if (this->cursor < 0) { + this->cursor = 0; + } else { + int prev = this->cursor - delta; + if (prev >= 0) { + this->cursor = prev; + } + } + if ((static_cast(GetKeyState(VK_SHIFT)) >> 8) == 0) { + this->anchor = this->cursor; + } +} // OFFSET: 0x00ACE660 // FUNCTION: fn_17791