From c0f1ac72d4fd129a3b9cf31208cc8190ebac2669 Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Thu, 27 Oct 2022 03:58:35 -0500 Subject: [PATCH] Remove redundant CURRENT_MAP calls Co-authored-by: sigonasr2 --- main.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/main.cpp b/main.cpp index 96c47eb..cdb3b9b 100644 --- a/main.cpp +++ b/main.cpp @@ -739,6 +739,7 @@ void SeasonI::SetGameFlag(Flag flag,bool val) { } void SeasonI::LoadMap(Map*map) { + CURRENT_MAP=map; std::ifstream f("assets/maps/"+map->filename,std::ios::binary); std::ifstream f2("assets/maps/"+map->l2filename,std::ios::binary); std::ifstream f3("assets/maps/"+map->l3filename,std::ios::binary); @@ -2290,8 +2291,7 @@ void SeasonI::keyUpdates() { case GameState::MAP_POSITION_SELECT:{ if (GetMouse(0).bReleased) { LAST_PLACED_TRIGGER->SetExtraCoords(HIGHLIGHTED_TILE*32); - CURRENT_MAP=ORIGINATING_MAP; - LoadMap(CURRENT_MAP); + LoadMap(ORIGINATING_MAP); CURRENT_MAP->triggers.push_back(LAST_PLACED_TRIGGER); LAST_PLACED_TRIGGER=nullptr; GAME_STATE=GameState::EDITOR; @@ -3022,8 +3022,7 @@ void SeasonI::drawGame(){ GetMousePos().x=drawpos.y&& GetMousePos().yGetAction(); Map*map=action->GetTargetMap(); - CURRENT_MAP=map; LoadMap(map); CurrentCutscene->AdvanceAction(); }break;