diff options
Diffstat (limited to 'frontend/cmd/get.cpp')
-rw-r--r-- | frontend/cmd/get.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/frontend/cmd/get.cpp b/frontend/cmd/get.cpp index 12c3353..8aa2d75 100644 --- a/frontend/cmd/get.cpp +++ b/frontend/cmd/get.cpp @@ -1,7 +1,7 @@ #include "../Player.h" #include "../strings.h" -#include "../print.h" +#include "backend/print.h" #include "backend/GoldObject.h" #include "backend/Location.h" @@ -9,11 +9,10 @@ using namespace std; FollowupAction Player::cmd_get(string & target_name) { unique_ptr<Object> target = nullptr; - for (Object * object : this->location.get_objects()) { - if (object->get_hidden() == true) continue; + for (Object * object : this->location.get_visible_objects()) { if (str_lower(object->get_name().c_str()) != str_lower(target_name)) continue; target = unique_ptr<Object>(object); - this->location.remove_object(object); + this->location.remove_visible_object(object); break; } if (target == nullptr) { |