aboutsummaryrefslogtreecommitdiff
path: root/frontend/cmd
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-10-30 22:05:16 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-10-30 22:05:16 +0100
commitff7390073ad42b9584aa2c509669867edab8c2f6 (patch)
tree9d6674ba6e7fcaf9b56516172195bab52dbe2dfe /frontend/cmd
parent80ed1262bd654fe2de30389f97a985b5f2c1d783 (diff)
fix List::remove
Diffstat (limited to 'frontend/cmd')
-rw-r--r--frontend/cmd/get.cpp2
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());