diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-01 23:42:57 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-01 23:42:57 +0100 |
commit | 671a25463419691bc6c8d11bd57d932bdea9632b (patch) | |
tree | 8898e076bfd4b3d702c7c765bcb9d6d41947198d /frontend/cmd/use.cpp | |
parent | f4d71aa6e241ae59ed7d305e8aadddf9d90b2b46 (diff) |
more cleanup
Diffstat (limited to 'frontend/cmd/use.cpp')
-rw-r--r-- | frontend/cmd/use.cpp | 8 |
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()); |