diff --git a/src/game_interpreter_map.cpp b/src/game_interpreter_map.cpp index 8d6a26537a1..9298969dd93 100644 --- a/src/game_interpreter_map.cpp +++ b/src/game_interpreter_map.cpp @@ -142,6 +142,8 @@ bool Game_Interpreter_Map::ExecuteCommand(lcf::rpg::EventCommand const& com) { return CommandOpenLoadMenu(com); case Cmd::ToggleAtbMode: return CommandToggleAtbMode(com); + case static_cast (2002): //Cmd::easyrpg_ActivateEvent + return CommandActivateEventAt(com); default: return Game_Interpreter::ExecuteCommand(com); } @@ -674,3 +676,11 @@ bool Game_Interpreter_Map::CommandToggleAtbMode(lcf::rpg::EventCommand const& /* Main_Data::game_system->ToggleAtbMode(); return true; } + +bool Game_Interpreter_Map::CommandActivateEventAt(lcf::rpg::EventCommand const& com) { + int x = ValueOrVariable(com.parameters[0], com.parameters[1]); + int y = ValueOrVariable(com.parameters[2], com.parameters[3]); + + bool b = Main_Data::game_player->ActivateEventAt(x, y); + return true; +} diff --git a/src/game_interpreter_map.h b/src/game_interpreter_map.h index 5dd41139eb6..0a43343fd56 100644 --- a/src/game_interpreter_map.h +++ b/src/game_interpreter_map.h @@ -81,6 +81,7 @@ class Game_Interpreter_Map : public Game_Interpreter bool CommandOpenMainMenu(lcf::rpg::EventCommand const& com); bool CommandOpenLoadMenu(lcf::rpg::EventCommand const& com); bool CommandToggleAtbMode(lcf::rpg::EventCommand const& com); + bool CommandActivateEventAt(lcf::rpg::EventCommand const& com); AsyncOp ContinuationShowInnStart(int indent, int choice_result, int price); diff --git a/src/game_player.cpp b/src/game_player.cpp index 33085d61dc6..d4bbcb134ac 100644 --- a/src/game_player.cpp +++ b/src/game_player.cpp @@ -835,3 +835,6 @@ void Game_Player::UpdatePan() { data()->pan_current_y -= dy; } +bool Game_Player::ActivateEventAt(int x, int y) { + return CheckEventTriggerThere({ lcf::rpg::EventPage::Trigger_action }, x, y, true); +} diff --git a/src/game_player.h b/src/game_player.h index f107866b0da..257cbbcc9cb 100644 --- a/src/game_player.h +++ b/src/game_player.h @@ -60,6 +60,8 @@ class Game_Player : public Game_PlayerBase { TeleportTarget GetTeleportTarget() const; void ResetTeleportTarget(TeleportTarget tt = {}); + bool Game_Player::ActivateEventAt(int x, int y); + /** * Sets the map, position and direction that the game player must have after the teleport is over *