Skip to content

Commit

Permalink
Merge pull request #259 from AnonymusRaccoon/fix_parser
Browse files Browse the repository at this point in the history
Fix parser
  • Loading branch information
Octopus773 authored Jun 20, 2021
2 parents 05f6eef + cc1ddc7 commit d8cf9a9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
7 changes: 6 additions & 1 deletion sources/Parser/ParserYaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ namespace BBM {
static std::map<std::string, Bonus::BonusType> map {
{"Bonus Bomb Up", Bonus::BonusType::BOMBSTOCK},
{"Bonus Speed Up", Bonus::BonusType::SPEEDUP},
{"Bonus Fire Up", Bonus::BonusType::EXPLOSIONINC}
{"Bonus Fire Up", Bonus::BonusType::EXPLOSIONINC},
{"Bonus Wallpass", Bonus::BonusType::NOCLIP}
};

return (std::to_string(map.at(bonusName)));
Expand Down Expand Up @@ -361,6 +362,8 @@ namespace BBM {
int block = 0;
if (!Utils::tryParse(blockType, block))
throw (ParserError("Couldn't parse block type."));
if (block < 0 || block > 7)
throw (ParserError("Couldn't parse block type."));
return (static_cast<MapGenerator::BlockType>(block));
}

Expand All @@ -371,6 +374,8 @@ namespace BBM {
int bonus = 0;
if (!Utils::tryParse(bonusType, bonus))
throw (ParserError("Couldn't parse bonus type."));
if (bonus < 0 || bonus > 4)
throw (ParserError("Couldn't parse bonus type."));
return (static_cast<Bonus::BonusType>(bonus));
}

Expand Down
2 changes: 0 additions & 2 deletions sources/Runner/PauseMenuScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,6 @@ namespace BBM
wal.getSystem<CameraSystem>().hasEnded = false;
gameState.nextScene = BBM::GameState::SceneID::MainMenuScene;
});
//needed material
//music
save.getComponent<OnClickComponent>().setButtonLinks(&settings);
play.getComponent<OnClickComponent>().setButtonLinks(nullptr, &save, nullptr, &settings);
settings.getComponent<OnClickComponent>().setButtonLinks(nullptr, &save, &play, &exit);
Expand Down
1 change: 1 addition & 0 deletions sources/System/Lobby/ResumeLobbySystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ namespace BBM
}
Runner::gameState.nextScene = BBM::GameState::SceneID::GameScene;
wal.getSystem<ResumeLobbySystem>().unloadLobbyFromResume();
ParserYAML::playersInfos.clear();
}

void ResumeLobbySystem::unloadLobbyFromResume()
Expand Down

0 comments on commit d8cf9a9

Please sign in to comment.