aboutsummaryrefslogtreecommitdiff
path: root/frontend/cmd/get.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/cmd/get.cpp')
-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());