Refactored Map Data access so that other locations in code no longer had write abilities to the map data. Changed permanent exit zone spawning to a temporary. Fix equipment items being duplicated due to sorted inventory not being in sync with actual inventory.

This commit is contained in:
2024-01-28 19:39:01 -06:00
parent 7162b151e4
commit 5c83a41a86
25 changed files with 201 additions and 58 deletions
@@ -51,7 +51,7 @@ void State_LevelComplete::OnStateChange(GameState*prevState){
}
Component<MenuLabel>(MenuType::LEVEL_COMPLETE,"Level EXP Gain Outline")->SetLabel(std::format("+{} Exp",game->GetPlayer()->GetAccumulatedXP()));
game->GetPlayer()->AddXP(game->GetPlayer()->GetAccumulatedXP());
for(const ItemMapData&data:game->GetCurrentMap().stageLoot){
for(const ItemMapData&data:game->GetCurrentMap().GetStageLoot()){
uint8_t amountDiff=data.maxAmt-data.minAmt;
uint8_t randomAmt=data.maxAmt;
if(amountDiff>0){ //This check avoids division by zero.