Returning to camp no longer rewards you stage items. Changed CloseAllMenus() to actually call CloseMenu() multiple times instead to prevent lockouts while holding down menu buttons and having menus closed on (such as getting hit by enemy attacks while in the pause menu). Release Build 7646.

pull/35/head
sigonasr2 11 months ago
parent e8ac5a957f
commit 08aa7a309d
  1. 7
      Adventures in Lestoria/Menu.cpp
  2. 21
      Adventures in Lestoria/State_LevelComplete.cpp
  3. 2
      Adventures in Lestoria/Version.h
  4. BIN
      x64/Release/Adventures in Lestoria.exe

@ -639,10 +639,9 @@ std::pair<MenuType,std::string>Menu::GetMemoryLeakReportInfo(){
} }
void Menu::CloseAllMenus(){ void Menu::CloseAllMenus(){
if(stack.size()>0){ if(stack.size()==0)ERR("WARNING! Trying to close out no menu?? Why are we doing this?");
stack.clear(); while(stack.size()>0){
}else{ CloseMenu();
ERR("WARNING! Trying to close out no menu?? Why are we doing this?")
} }
} }

@ -61,15 +61,18 @@ void State_LevelComplete::OnStateChange(GameState*prevState){
Component<ProgressBar>(MenuType::LEVEL_COMPLETE,"XP Bar")->ResetProgressBar(game->GetPlayer()->CurrentXP(),game->GetPlayer()->NextLevelXPRequired()); Component<ProgressBar>(MenuType::LEVEL_COMPLETE,"XP Bar")->ResetProgressBar(game->GetPlayer()->CurrentXP(),game->GetPlayer()->NextLevelXPRequired());
accumulatedXP=game->GetPlayer()->GetAccumulatedXP(); accumulatedXP=game->GetPlayer()->GetAccumulatedXP();
game->GetPlayer()->AddXP(game->GetPlayer()->GetAccumulatedXP()); game->GetPlayer()->AddXP(game->GetPlayer()->GetAccumulatedXP());
for(const ItemMapData&data:game->GetCurrentMap().GetStageLoot()){
uint8_t amountDiff=data.maxAmt-data.minAmt; if(Component<MenuLabel>(LEVEL_COMPLETE,"Stage Complete Label")->GetLabel()!="Stage Summary"){ //If the label says stage summary, we didn't actually the level. Don't reward any stage items to the player.
uint8_t randomAmt=data.maxAmt; for(const ItemMapData&data:game->GetCurrentMap().GetStageLoot()){
if(amountDiff>0){ //This check avoids division by zero. uint8_t amountDiff=data.maxAmt-data.minAmt;
randomAmt=util::random()%(amountDiff+1)+data.minAmt; uint8_t randomAmt=data.maxAmt;
} if(amountDiff>0){ //This check avoids division by zero.
for(uint8_t rolls=0;rolls<randomAmt;rolls++){ randomAmt=util::random()%(amountDiff+1)+data.minAmt;
if(util::random(1.0f)<data.chance/100.f){ }
Inventory::AddItem(data.item,1U); for(uint8_t rolls=0;rolls<randomAmt;rolls++){
if(util::random(1.0f)<data.chance/100.f){
Inventory::AddItem(data.item,1U);
}
} }
} }
} }

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 0 #define VERSION_MAJOR 0
#define VERSION_MINOR 3 #define VERSION_MINOR 3
#define VERSION_PATCH 0 #define VERSION_PATCH 0
#define VERSION_BUILD 7644 #define VERSION_BUILD 7646
#define stringify(a) stringify_(a) #define stringify(a) stringify_(a)
#define stringify_(a) #a #define stringify_(a) #a

Loading…
Cancel
Save