Skip to content

Commit

Permalink
Simplified
Browse files Browse the repository at this point in the history
  • Loading branch information
MiranDMC committed Dec 2, 2024
1 parent 92ebb15 commit 07ae82a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
14 changes: 0 additions & 14 deletions cleo_plugins/DebugUtils/DebugUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class DebugUtils

// limits for processing after which script is considered hanging
static size_t configLimitCommand;
static size_t configLimitJump;

// breakpoint continue keys
static const int KeyFirst = VK_F5;
Expand All @@ -51,7 +50,6 @@ class DebugUtils

auto config = GetConfigFilename();
configLimitCommand = GetPrivateProfileInt("Limits", "Command", 100000, config.c_str());
configLimitJump = GetPrivateProfileInt("Limits", "Jump", 20000, config.c_str());

// register opcodes
CLEO_RegisterOpcode(0x00C3, Opcode_DebugOn);
Expand Down Expand Up @@ -204,17 +202,6 @@ class DebugUtils
return pScript->Suspend();
}

if (opcode == 0x0002 || opcode == 0x004D) // goto, goto_if_false
{
currScript.jumpCounter++;

if (currScript.jumpCounter > configLimitJump)
{
SHOW_ERROR("Over %d,%03d jump commands executed in a single frame by script %s \nTo prevent the game from freezing, CLEO suspended this script.\n\nTo ignore this error, increase 'jump' property in %s.ini file and restart the game.", configLimitJump / 1000, configLimitJump % 1000, ScriptInfoStr(pScript).c_str(), TARGET_NAME);
return pScript->Suspend();
}
}

return OR_NONE;
}

Expand Down Expand Up @@ -415,7 +402,6 @@ ScreenLog DebugUtils::screenLog = {};
std::deque<DebugUtils::PausedScriptInfo> DebugUtils::pausedScripts;
ScriptLog DebugUtils::currScript = {};
size_t DebugUtils::configLimitCommand;
size_t DebugUtils::configLimitJump;
bool DebugUtils::keysReleased = true;
std::map<std::string, std::ofstream> DebugUtils::logFiles;

3 changes: 1 addition & 2 deletions cleo_plugins/DebugUtils/SA.DebugUtils.ini
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,4 @@ ColorSystem = "DDDDDDFF"

; limits between 'wait' command in script after which it is considered hanging
[Limits]
command = 100000
jump = 20000
command = 200000

0 comments on commit 07ae82a

Please sign in to comment.