Skip to content

Commit

Permalink
Fixed TestCheat opcode. (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
MiranDMC authored Apr 8, 2024
1 parent e01844d commit 5730ef2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions source/CCustomOpcodeSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5730ef2

Please sign in to comment.