diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-30 20:31:18 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-30 20:31:18 +0100 |
commit | d8daa3e045ca2f41edcbed533bc5a9fef1363a17 (patch) | |
tree | 6a4c0883d05607476b609e68bcac7d854e281aea /frontend/cmd/get.cpp | |
parent | 6e1d62955c7a7f39bc9126d709a42a70e02a1d30 (diff) |
print to backend
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) { |