Fix bug with leaving a stage via the pause menu while not having cleared a stage causing the unlock to still occur. Release Build 8656.

mac-build
sigonasr2 10 months ago
parent 84c8ceb898
commit 133dc1a2e0
  1. 11
      Adventures in Lestoria/AdventuresInLestoria.cpp
  2. 4
      Adventures in Lestoria/AdventuresInLestoria.h
  3. 2
      Adventures in Lestoria/PauseMenu.cpp
  4. 1
      Adventures in Lestoria/Player.cpp
  5. 2
      Adventures in Lestoria/State_OverworldMap.cpp
  6. 2
      Adventures in Lestoria/Version.h
  7. BIN
      x64/Release/Adventures in Lestoria.exe

@ -3972,4 +3972,15 @@ const bool AiL::QuitRequested()const{
}
void AiL::SetQuitAllowed(bool quittingAllowed){
savingFile=!quittingAllowed;
}
const bool AiL::PreviousStageCompleted()const{
return prevStageCompleted;
}
void AiL::SetCompletedStageFlag(){
prevStageCompleted=true;
}
void AiL::ResetCompletedStageFlag(){
prevStageCompleted=false;
}

@ -184,6 +184,7 @@ private:
bool displayHud=true;
float vignetteDisplayTime=0.f;
bool savingFile=false;
bool prevStageCompleted=false;
void ValidateGameStatus();
void _PrepareLevel(MapName map,MusicChange changeMusic);
@ -325,6 +326,9 @@ public:
void GlobalGameUpdates();
const bool QuitRequested()const;
void SetQuitAllowed(bool quittingAllowed); //Locks the game from quitting during sensitive operations such as file saving/loading.
const bool PreviousStageCompleted()const;
void SetCompletedStageFlag();
void ResetCompletedStageFlag();
struct TileGroupData{
vi2d tilePos;

@ -74,7 +74,7 @@ void Menu::InitializePauseWindow(){
Component<MenuLabel>(LEVEL_COMPLETE,"Stage Complete Label")->SetLabel("Stage Summary");
Component<MenuComponent>(LEVEL_COMPLETE,"Level Details Outline")->SetLabel("");
if(game->GetCurrentMapName()=="HUB")Unlock::UnlockCurrentMap(); //Special unlock for the hub area when leaving.
if(game->GetCurrentMapName()=="HUB"&&game->PreviousStageCompleted())Unlock::UnlockCurrentMap(); //Special unlock for the hub area when leaving.
if(Unlock::IsUnlocked("STORY_1_1")){
Component<MenuComponent>(LEVEL_COMPLETE,"Next Button")->Enable();

@ -1065,6 +1065,7 @@ void Player::CheckEndZoneCollision(){
endZoneStandTime+=game->GetElapsedTime();
if(endZoneStandTime>="Player.End Zone Wait Time"_F){
Component<MenuLabel>(LEVEL_COMPLETE,"Stage Complete Label")->SetLabel("Stage Completed");
game->SetCompletedStageFlag();
Component<MenuComponent>(LEVEL_COMPLETE,"Level Details Outline")->SetLabel("Complete Bonus\n +10% XP");
if(Unlock::IsUnlocked("STORY_1_1")){
Component<MenuComponent>(LEVEL_COMPLETE,"Next Button")->Enable();

@ -61,6 +61,8 @@ void State_OverworldMap::OnStateChange(GameState*prevState){
Component<MenuComponent>(MenuType::PAUSE,"Return to Camp Button")->SetGrayedOut(false);
SaveFile::SaveGame();
game->ResetCompletedStageFlag();
if(Unlock::IsUnlocked("STORY_1_3")){
game->SetChapter(2);
}

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1
#define VERSION_MINOR 1
#define VERSION_PATCH 0
#define VERSION_BUILD 8655
#define VERSION_BUILD 8656
#define stringify(a) stringify_(a)
#define stringify_(a) #a

Loading…
Cancel
Save