From ff7390073ad42b9584aa2c509669867edab8c2f6 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Wed, 30 Oct 2024 22:05:16 +0100 Subject: fix List::remove --- frontend/cmd/get.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'frontend/cmd') 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); - 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(target.get()); -- cgit v1.2.3