From 5f5bf3ac7a85f8cde512ec44e3d55b93fb4354ba Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Sun, 3 Nov 2024 12:43:18 +0100 Subject: remove more pointers from frontend --- frontend/cmd/go.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'frontend/cmd/go.cpp') 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); } -- cgit v1.2.3