aboutsummaryrefslogtreecommitdiff
path: root/frontend/cmd/use.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/cmd/use.cpp')
-rw-r--r--frontend/cmd/use.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/frontend/cmd/use.cpp b/frontend/cmd/use.cpp
index c636077..002255a 100644
--- a/frontend/cmd/use.cpp
+++ b/frontend/cmd/use.cpp
@@ -5,7 +5,7 @@
#include "backend/print.h"
#include "../GameController.h"
-#include "../strings.h"
+#include "../util.h"
using namespace std;
@@ -13,11 +13,7 @@ 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(),
- [target_name] (Object * object) {
- return str_lower(object->get_name().c_str()) == str_lower(target_name);
- }
- );
+ auto it = find_if(player.inventory.begin(), player.inventory.end(), by_name_case_insensitive(target_name));
if (!it)
throw Exception("object \"%s\" niet gevonden", target_name.c_str());