From 602a70f9a78dd7a7adfec12acc83e9451e3a858c Mon Sep 17 00:00:00 2001 From: Ghabry Date: Sun, 12 Sep 2021 12:11:26 +0200 Subject: [PATCH] Maniac: Warn about unimplemented Loop enhancements --- src/game_interpreter.cpp | 12 +++++++++++- src/game_interpreter.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/game_interpreter.cpp b/src/game_interpreter.cpp index 87fd9fa3dc..77feb1bb66 100644 --- a/src/game_interpreter.cpp +++ b/src/game_interpreter.cpp @@ -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: @@ -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; diff --git a/src/game_interpreter.h b/src/game_interpreter.h index 63aeec8ae8..192b543e3d 100644 --- a/src/game_interpreter.h +++ b/src/game_interpreter.h @@ -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);