aboutsummaryrefslogtreecommitdiff
path: root/frontend/cmd/use.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-11-02 13:18:50 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-11-02 13:18:50 +0100
commit5a675c5e6833e98b92b55396594bc0d607b98903 (patch)
treeb252fafe921e7734a13d796b950e5ab817a22a1f /frontend/cmd/use.cpp
parent671a25463419691bc6c8d11bd57d932bdea9632b (diff)
clean up code + implement teleport consumable
Diffstat (limited to 'frontend/cmd/use.cpp')
-rw-r--r--frontend/cmd/use.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/frontend/cmd/use.cpp b/frontend/cmd/use.cpp
index 002255a..3134210 100644
--- a/frontend/cmd/use.cpp
+++ b/frontend/cmd/use.cpp
@@ -12,8 +12,8 @@ using namespace std;
void GameController::cmd_use(string & target_name) {
Player & player = this->dungeon->get_player();
Location & location = player.get_location();
-
- auto it = find_if(player.inventory.begin(), player.inventory.end(), by_name_case_insensitive(target_name));
+
+ auto it = find_if_range(player.inventory.range(), by_name_case_insensitive(target_name));
if (!it)
throw Exception("object \"%s\" niet gevonden", target_name.c_str());