aboutsummaryrefslogtreecommitdiff
path: root/frontend/cmd/go.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-11-03 12:43:18 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-11-03 12:43:18 +0100
commit5f5bf3ac7a85f8cde512ec44e3d55b93fb4354ba (patch)
tree517b955e4e2ecddf185dfd13dcdc4bcf57f4588a /frontend/cmd/go.cpp
parented78baff64fe45479ca6c480d985ce0f9c0c9515 (diff)
remove more pointers from frontend
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);
}