diff --git a/src/game_interpreter_map.cpp b/src/game_interpreter_map.cpp index dd1b016f75..9b166baed2 100644 --- a/src/game_interpreter_map.cpp +++ b/src/game_interpreter_map.cpp @@ -269,13 +269,13 @@ bool Game_Interpreter_Map::CommandRecallToLocation(lcf::rpg::EventCommand const& } bool Game_Interpreter_Map::CommandEnemyEncounter(lcf::rpg::EventCommand const& com) { // code 10710 - auto& frame = GetFrame(); - auto& index = frame.current_command; - if (Game_Message::IsMessageActive()) { return false; } + auto& frame = GetFrame(); + auto& index = frame.current_command; + BattleArgs args; args.troop_id = ValueOrVariable(com.parameters[0], com.parameters[1]); @@ -366,13 +366,13 @@ bool Game_Interpreter_Map::CommandEndBattle(lcf::rpg::EventCommand const& /* com } bool Game_Interpreter_Map::CommandOpenShop(lcf::rpg::EventCommand const& com) { // code 10720 - auto& frame = GetFrame(); - auto& index = frame.current_command; - if (Game_Message::IsMessageActive()) { return false; } + auto& frame = GetFrame(); + auto& index = frame.current_command; + bool allow_buy = false; bool allow_sell = false; @@ -394,7 +394,7 @@ bool Game_Interpreter_Map::CommandOpenShop(lcf::rpg::EventCommand const& com) { auto shop_type = com.parameters[1]; // Not used, but left here for documentation purposes - //bool has_shop_handlers = com.parameters[2] != 0; + // bool has_shop_handlers = com.parameters[2] != 0; std::vector goods; for (auto it = com.parameters.begin() + 4; it < com.parameters.end(); ++it) { @@ -544,13 +544,13 @@ bool Game_Interpreter_Map::CommandEndInn(lcf::rpg::EventCommand const& /* com */ } bool Game_Interpreter_Map::CommandEnterHeroName(lcf::rpg::EventCommand const& com) { // code 10740 - auto& frame = GetFrame(); - auto& index = frame.current_command; - if (Game_Message::IsMessageActive()) { return false; } + auto& frame = GetFrame(); + auto& index = frame.current_command; + auto actor_id = com.parameters[0]; auto charset = com.parameters[1]; auto use_default_name = com.parameters[2]; @@ -715,26 +715,26 @@ bool Game_Interpreter_Map::CommandPlayMovie(lcf::rpg::EventCommand const& com) { } bool Game_Interpreter_Map::CommandOpenSaveMenu(lcf::rpg::EventCommand const& /* com */) { // code 11910 - auto& frame = GetFrame(); - auto& index = frame.current_command; - if (Game_Message::IsMessageActive()) { return false; } + auto& frame = GetFrame(); + auto& index = frame.current_command; + Scene::instance->SetRequestedScene(std::make_shared()); ++index; return false; } bool Game_Interpreter_Map::CommandOpenMainMenu(lcf::rpg::EventCommand const&) { // code 11950 - auto& frame = GetFrame(); - auto& index = frame.current_command; - if (Game_Message::IsMessageActive()) { return false; } + auto& frame = GetFrame(); + auto& index = frame.current_command; + int subscreen_id = -1, actor_index = 0; bool is_db_actor = false; @@ -750,13 +750,13 @@ bool Game_Interpreter_Map::CommandOpenLoadMenu(lcf::rpg::EventCommand const& /* return true; } - auto& frame = GetFrame(); - auto& index = frame.current_command; - if (Game_Message::IsMessageActive()) { return false; } + auto& frame = GetFrame(); + auto& index = frame.current_command; + Scene::instance->SetRequestedScene(std::make_shared()); ++index; return false; diff --git a/src/game_map.cpp b/src/game_map.cpp index 51e7cdc01e..127ff90abe 100644 --- a/src/game_map.cpp +++ b/src/game_map.cpp @@ -981,14 +981,6 @@ int Game_Map::GetTerrainTag(int x, int y) { return terrain_data[chip_index]; } -void Game_Map::GetEventsXY(std::vector& events, int x, int y) { - for (Game_Event& ev : GetEvents()) { - if (ev.IsInPosition(x, y) && ev.IsActive()) { - events.push_back(&ev); - } - } -} - Game_Event* Game_Map::GetEventAt(int x, int y, bool require_active) { auto& events = GetEvents(); for (auto iter = events.rbegin(); iter != events.rend(); ++iter) { diff --git a/src/game_map.h b/src/game_map.h index e9ea966e28..eb35fa7271 100644 --- a/src/game_map.h +++ b/src/game_map.h @@ -577,8 +577,6 @@ namespace Game_Map { */ std::vector& GetCommonEvents(); - void GetEventsXY(std::vector& events, int x, int y); - /** * @param x x position on the map * @param y y position on the map diff --git a/src/tilemap_layer.cpp b/src/tilemap_layer.cpp index b9736d48d7..df8c62c436 100644 --- a/src/tilemap_layer.cpp +++ b/src/tilemap_layer.cpp @@ -259,9 +259,6 @@ void TilemapLayer::Draw(Bitmap& dst, uint8_t z_order, int render_ox, int render_ if (loop_h) map_x = mod(map_x, width); if (loop_v) map_y = mod(map_y, height); - int map_draw_x = x * TILE_SIZE - mod_ox; - int map_draw_y = y * TILE_SIZE - mod_oy; - bool out_of_bounds = map_x < 0 || map_x >= width || map_y < 0 || map_y >= height; @@ -270,6 +267,9 @@ void TilemapLayer::Draw(Bitmap& dst, uint8_t z_order, int render_ox, int render_ continue; } + int map_draw_x = x * TILE_SIZE - mod_ox; + int map_draw_y = y * TILE_SIZE - mod_oy; + // Get the tile data TileData &tile = GetDataCache(map_x, map_y);