Skip to content

Commit

Permalink
Maniac: Warn about unimplemented Loop enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghabry committed Sep 13, 2021
1 parent 5094f93 commit 602a70f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/game_interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ bool Game_Interpreter::ExecuteCommand() {
case Cmd::JumpToLabel:
return CommandJumpToLabel(com);
case Cmd::Loop:
return true;
return CommandLoop(com);
case Cmd::BreakLoop:
return CommandBreakLoop(com);
case Cmd::EndLoop:
Expand Down Expand Up @@ -3501,6 +3501,16 @@ bool Game_Interpreter::CommandJumpToLabel(lcf::rpg::EventCommand const& com) { /
return true;
}

bool Game_Interpreter::CommandLoop(lcf::rpg::EventCommand const& com) { // code 12210
if (!Player::IsPatchManiac() || com.parameters.empty() || com.parameters[0] == 0) {
// Infinite Loop
return true;
}

Output::Warning("Maniac CommandLoop: Conditional loops unsupported");
return true;
}

bool Game_Interpreter::CommandBreakLoop(lcf::rpg::EventCommand const& /* com */) { // code 12220
auto& frame = GetFrame();
const auto& list = frame.commands;
Expand Down
1 change: 1 addition & 0 deletions src/game_interpreter.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ class Game_Interpreter
bool CommandElseBranch(lcf::rpg::EventCommand const& com);
bool CommandEndBranch(lcf::rpg::EventCommand const& com);
bool CommandJumpToLabel(lcf::rpg::EventCommand const& com);
bool CommandLoop(lcf::rpg::EventCommand const& com);
bool CommandBreakLoop(lcf::rpg::EventCommand const& com);
bool CommandEndLoop(lcf::rpg::EventCommand const& com);
bool CommandEraseEvent(lcf::rpg::EventCommand const& com);
Expand Down

0 comments on commit 602a70f

Please sign in to comment.