fix: fixed game not exiting when typing q
This commit is contained in:
parent
273e135762
commit
7b10c3bca9
2 changed files with 5 additions and 3 deletions
3
Game.cpp
3
Game.cpp
|
@ -106,9 +106,6 @@ namespace game // Namespace = Scope with name and no features
|
|||
{
|
||||
movement_vector = handle_user_input(game_input);
|
||||
} catch (UnkownAction& err)
|
||||
{
|
||||
cout << err.what() << "\n";
|
||||
} catch (ExitGame& err)
|
||||
{
|
||||
cout << err.what() << "\n";
|
||||
}
|
||||
|
|
5
main.cpp
5
main.cpp
|
@ -3,6 +3,7 @@
|
|||
#include "PositionVector.h"
|
||||
#include "MazeParser.h"
|
||||
#include "Game.h"
|
||||
#include "Exceptions/ExitGame.h"
|
||||
#include "Exceptions/MalformedMaze.h"
|
||||
#include "Exceptions/MovementNotPossible.h"
|
||||
#include "Exceptions/UnkownAction.h"
|
||||
|
@ -16,6 +17,7 @@ using game::Game;
|
|||
using game_exceptions::MalformedMaze;
|
||||
using game_exceptions::UnkownAction;
|
||||
using game_exceptions::MovementNotPossible;
|
||||
using game_exceptions::ExitGame;
|
||||
|
||||
// Ein Programm, welches dir erlaubt ein Labyrinth zu erkunden mit 'w', 'a', 's', und 'd'.
|
||||
|
||||
|
@ -34,6 +36,9 @@ int main()
|
|||
// Das Labyrinth einlesen hat nicht geklappt. Gebe Fehlermeldung aus und beende das Programm.
|
||||
cout << "Fehler beim Einlesen des Labyrinths.\n";
|
||||
return 0;
|
||||
} catch (ExitGame& err)
|
||||
{
|
||||
cout << err.what() << "\n";
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue