diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-30 22:05:16 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-30 22:05:16 +0100 |
commit | ff7390073ad42b9584aa2c509669867edab8c2f6 (patch) | |
tree | 9d6674ba6e7fcaf9b56516172195bab52dbe2dfe /frontend/cmd | |
parent | 80ed1262bd654fe2de30389f97a985b5f2c1d783 (diff) |
fix List::remove
Diffstat (limited to 'frontend/cmd')
-rw-r--r-- | frontend/cmd/get.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/frontend/cmd/get.cpp b/frontend/cmd/get.cpp index 8aa2d75..2a35657 100644 --- a/frontend/cmd/get.cpp +++ b/frontend/cmd/get.cpp @@ -12,13 +12,13 @@ FollowupAction Player::cmd_get(string & target_name) { 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_visible_object(object); break; } if (target == nullptr) { lprtf("Object \"%s\" niet gevonden\n", target_name.c_str()); return FollowupAction::NONE; } + this->location.remove_visible_object(target.get()); // gold objects are collected and (implicitly) destroyed GoldObject * gold = dynamic_cast<GoldObject *>(target.get()); |