Extra checks to prevent the player from moving

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
master
sigonasr2 2 years ago
parent e06a261873
commit fcdfc8065b
  1. BIN
      C++ProjectTemplate
  2. 4
      main.cpp

Binary file not shown.

@ -1013,7 +1013,7 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
if (GetKey(F5).bPressed) { if (GetKey(F5).bPressed) {
GAME_STATE=GameState::EDITOR; GAME_STATE=GameState::EDITOR;
} else } else
if (ACTIONKEYPRESSED) { if (PlayerCanMove()&&ACTIONKEYPRESSED) {
GAME_STATE=GameState::OVERWORLD_MENU; GAME_STATE=GameState::OVERWORLD_MENU;
OVERWORLD_MENU_SELECTION=0; OVERWORLD_MENU_SELECTION=0;
} }
@ -2394,7 +2394,7 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
} }
bool PlayerCanMove(){ bool PlayerCanMove(){
return BATTLE_ENCOUNTER==nullptr&&!IsTextEntryEnabled()&&!messageBoxVisible&&PARTY_MEMBER_OBJ[0]!=nullptr; return GAME_STATE==GameState::GAME_WORLD&&BATTLE_ENCOUNTER==nullptr&&!IsTextEntryEnabled()&&!messageBoxVisible&&PARTY_MEMBER_OBJ[0]!=nullptr&&CurrentCutscene==nullptr;
} }
void DisplayMessageBox(std::string targetText) { void DisplayMessageBox(std::string targetText) {

Loading…
Cancel
Save