From 75159a21be8c57517b304f244dcfb368b14312aa Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Thu, 9 Nov 2023 01:41:05 -0600 Subject: [PATCH] On game state changes, the camera target should be reset to the player's location. --- Crawler/GameState.h | 4 +++- Crawler/Menu.cpp | 4 ---- Crawler/Version.h | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Crawler/GameState.h b/Crawler/GameState.h index 9a71578b..59152d5f 100644 --- a/Crawler/GameState.h +++ b/Crawler/GameState.h @@ -1,8 +1,9 @@ #pragma once #include #include +#include "Crawler.h" -class Crawler; +INCLUDE_game namespace States{ enum State{ @@ -27,6 +28,7 @@ public: throw; } STATE=states.at(newState); + game->camera.SetTarget(game->GetPlayer()->GetPos()); STATE->OnStateChange(prevState); } }; \ No newline at end of file diff --git a/Crawler/Menu.cpp b/Crawler/Menu.cpp index 99c504eb..458fd682 100644 --- a/Crawler/Menu.cpp +++ b/Crawler/Menu.cpp @@ -642,9 +642,5 @@ std::pairMenu::GetMemoryLeakReportInfo(){ } void Menu::CloseAllMenus(){ - if(stack.size()<=0){ - std::cout<<"WARNING! Trying to close out no menu?? Why are we doing this?"<