diff --git a/src/creatures/monsters/monster.cpp b/src/creatures/monsters/monster.cpp index 9dd44c61e93..cb0296b5c3f 100644 --- a/src/creatures/monsters/monster.cpp +++ b/src/creatures/monsters/monster.cpp @@ -354,10 +354,9 @@ void Monster::onRemoveCreature(const std::shared_ptr &creature, bool i setIdle(true); } else { - addAsyncTask([this, creature_weak = std::weak_ptr(creature)] { - if (const auto creature = creature_weak.lock()) { - onCreatureLeave(creature); - } }); + addAsyncTask([this, creature] { + onCreatureLeave(creature); + }); } }