On game state changes, the camera target should be reset to the player's location.

pull/28/head
sigonasr2 1 year ago
parent 2e248e30b4
commit 75159a21be
  1. 4
      Crawler/GameState.h
  2. 4
      Crawler/Menu.cpp
  3. 2
      Crawler/Version.h

@ -1,8 +1,9 @@
#pragma once #pragma once
#include <map> #include <map>
#include <iostream> #include <iostream>
#include "Crawler.h"
class Crawler; INCLUDE_game
namespace States{ namespace States{
enum State{ enum State{
@ -27,6 +28,7 @@ public:
throw; throw;
} }
STATE=states.at(newState); STATE=states.at(newState);
game->camera.SetTarget(game->GetPlayer()->GetPos());
STATE->OnStateChange(prevState); STATE->OnStateChange(prevState);
} }
}; };

@ -642,9 +642,5 @@ std::pair<MenuType,std::string>Menu::GetMemoryLeakReportInfo(){
} }
void Menu::CloseAllMenus(){ void Menu::CloseAllMenus(){
if(stack.size()<=0){
std::cout<<"WARNING! Trying to close out no menu?? Why are we doing this?"<<std::endl;
throw;
}
stack.clear(); stack.clear();
} }

@ -2,7 +2,7 @@
#define VERSION_MAJOR 0 #define VERSION_MAJOR 0
#define VERSION_MINOR 2 #define VERSION_MINOR 2
#define VERSION_PATCH 1 #define VERSION_PATCH 1
#define VERSION_BUILD 2548 #define VERSION_BUILD 2559
#define stringify(a) stringify_(a) #define stringify(a) stringify_(a)
#define stringify_(a) #a #define stringify_(a) #a

Loading…
Cancel
Save