aboutsummaryrefslogtreecommitdiff
path: root/frontend/cmd/search.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-10-31 14:14:09 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-10-31 14:14:09 +0100
commitf8d8d7499ba4433678db2a68fb1cae74448ca31e (patch)
treefc96bef89fc3206277d1fcf1e3df5ad733b7e652 /frontend/cmd/search.cpp
parenta0e14fa424494ed35da1bd6e5e54bb36178259a7 (diff)
make ListIterator continue working on a changing list
Diffstat (limited to 'frontend/cmd/search.cpp')
-rw-r--r--frontend/cmd/search.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/frontend/cmd/search.cpp b/frontend/cmd/search.cpp
index 16e4592..f10709a 100644
--- a/frontend/cmd/search.cpp
+++ b/frontend/cmd/search.cpp
@@ -7,17 +7,14 @@ using namespace std;
FollowupAction Player::cmd_search(string &) {
bool found = false;
- List<Object *> to_unhide;
for (Object * object : this->location.get_hidden_objects()) {
if (!found) lprtf("Je vindt:\n");
lprtf("- %s\n", object->get_displayname().c_str());
- to_unhide.push_back(object);
+ this->location.unhide_object(object);
found = true;
}
if (!found)
lprtf("Je hebt niks gevonden.\n");
- for (Object * object : to_unhide)
- this->location.unhide_object(object);
return FollowupAction::UPDATE;
}