From 671a25463419691bc6c8d11bd57d932bdea9632b Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Fri, 1 Nov 2024 23:42:57 +0100 Subject: more cleanup --- frontend/cmd/use.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'frontend/cmd/use.cpp') 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()); -- cgit v1.2.3