From 659bc274e3c576e401030df2091a43ea7817d716 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 12 Nov 2026 16:58:04 +0000 Subject: [PATCH] Decompile 2 functions in Source/Client/Input/VietnameseInput.cpp Batch #18626 by eAthena: 0 byte-identical, 2 confirmed by peer review. - fn_18308 TELEXInputMode::Convert: logic confirmed by peer review - fn_18318 VNIInputMode::Convert: logic confirmed by peer review Peer-reviewed-by: kyoshi, cremane, bibinir Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Client/Input/VietnameseInput.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Source/Client/Input/VietnameseInput.cpp b/Source/Client/Input/VietnameseInput.cpp index 8d5853804..83ec34512 100644 --- a/Source/Client/Input/VietnameseInput.cpp +++ b/Source/Client/Input/VietnameseInput.cpp @@ -30,13 +30,14 @@ TELEXInputMode::TELEXInputMode() { // OFFSET: 0x00AFBB40 // FUNCTION: fn_18308 -int TELEXInputMode::Convert(char key, char vowel, int index) { +int TELEXInputMode::Convert(char key, char vowel, int value) { + int index = value; if (key == this->m_lastKey) { this->Reset(); return 1000; } int tone = 0; - while (key != g_telexToneKeys[tone] && tone < 5) { + while (g_telexToneKeys[tone] != key && tone < 5) { ++tone; } if (tone < 5) { @@ -251,7 +252,8 @@ VNIInputMode::VNIInputMode() { // OFFSET: 0x00AFC210 // FUNCTION: fn_18318 -int VNIInputMode::Convert(char key, char vowel, int index) { +int VNIInputMode::Convert(char key, char vowel, int value) { + int index = value; if (key == this->m_lastKey) { this->Reset(); return 1000; @@ -270,8 +272,8 @@ int VNIInputMode::Convert(char key, char vowel, int index) { this->m_toneIndex = key - '0'; index = index - '6' + key; } else { - this->Reset(); index = -1; + this->Reset(); } break; case '6': @@ -283,8 +285,8 @@ int VNIInputMode::Convert(char key, char vowel, int index) { this->m_markKey = 6; index += 6; } else { - this->Reset(); index = -1; + this->Reset(); } break; case '7': @@ -300,8 +302,8 @@ int VNIInputMode::Convert(char key, char vowel, int index) { this->m_markKey = 6; index += 6; } else { - this->Reset(); index = -1; + this->Reset(); } break; case '8': @@ -313,8 +315,8 @@ int VNIInputMode::Convert(char key, char vowel, int index) { this->m_markKey = 12; index += 12; } else { - this->Reset(); index = -1; + this->Reset(); } break; case '9':