aboutsummaryrefslogtreecommitdiff
path: root/frontend/cmd/go.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/cmd/go.cpp')
-rw-r--r--frontend/cmd/go.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/frontend/cmd/go.cpp b/frontend/cmd/go.cpp
index 6fb9105..0452897 100644
--- a/frontend/cmd/go.cpp
+++ b/frontend/cmd/go.cpp
@@ -22,13 +22,11 @@ void GameController::cmd_go(string & direction_str) {
Player & player = this->dungeon->get_player();
Direction direction = direction_map.at(direction_str);
- Location * next_location = player.get_location().get_exit(direction);
- if (next_location == nullptr)
- throw Exception("er is geen uitgang in deze richting");
+ Location & next_location = player.get_location().get_exit(direction);
this->dungeon->update();
if (!player.is_dead())
- player.set_location(*next_location);
+ player.set_location(next_location);
}