From dfb470bcb56c2e16182426d5289e31a333a09fac Mon Sep 17 00:00:00 2001 From: Miran Date: Mon, 8 Apr 2024 02:36:59 +0200 Subject: [PATCH] Fixed TestCheat opcode. --- source/CCustomOpcodeSystem.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/CCustomOpcodeSystem.cpp b/source/CCustomOpcodeSystem.cpp index c05fd2c8..e4cbc81c 100644 --- a/source/CCustomOpcodeSystem.cpp +++ b/source/CCustomOpcodeSystem.cpp @@ -1347,10 +1347,11 @@ namespace CLEO //0ADC=1, test_cheat %1d% OpcodeResult __stdcall opcode_0ADC(CRunningScript *thread) { - OPCODE_READ_PARAM_STRING(text); - - auto len = strlen(text); - if (_strnicmp(text, CCheat::m_CheatString, len) == 0) + OPCODE_READ_PARAM_STRING_LEN(text, sizeof(CCheat::m_CheatString)); + + _strrev(_buff_text); // reverse + auto len = strlen(_buff_text); + if (_strnicmp(_buff_text, CCheat::m_CheatString, len) == 0) { CCheat::m_CheatString[0] = '\0'; // consume the cheat SetScriptCondResult(thread, true);