aboutsummaryrefslogtreecommitdiff
path: root/frontend/cmd/search.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-10-30 20:31:18 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-10-30 20:31:18 +0100
commitd8daa3e045ca2f41edcbed533bc5a9fef1363a17 (patch)
tree6a4c0883d05607476b609e68bcac7d854e281aea /frontend/cmd/search.cpp
parent6e1d62955c7a7f39bc9126d709a42a70e02a1d30 (diff)
print to backend
Diffstat (limited to 'frontend/cmd/search.cpp')
-rw-r--r--frontend/cmd/search.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/frontend/cmd/search.cpp b/frontend/cmd/search.cpp
index 67b0bf1..f10709a 100644
--- a/frontend/cmd/search.cpp
+++ b/frontend/cmd/search.cpp
@@ -1,17 +1,16 @@
#include "../Player.h"
-#include "../print.h"
+#include "backend/print.h"
#include "backend/Location.h"
using namespace std;
FollowupAction Player::cmd_search(string &) {
bool found = false;
- for (Object * object : this->location.get_objects()) {
- if (object->get_hidden() == false) continue;
+ for (Object * object : this->location.get_hidden_objects()) {
if (!found) lprtf("Je vindt:\n");
- lprtf("- %s\n", object->get_displayname());
- object->set_hidden(false);
+ lprtf("- %s\n", object->get_displayname().c_str());
+ this->location.unhide_object(object);
found = true;
}
if (!found)