fix: fixed game not exiting when typing q

This commit is contained in:
moonleay 2024-12-17 14:35:22 +01:00
parent 273e135762
commit 7b10c3bca9
Signed by: moonleay
GPG key ID: 82667543CCD715FB
2 changed files with 5 additions and 3 deletions

View file

@ -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";
}

View file

@ -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";
}