diff --git a/src/creatures/creature.cpp b/src/creatures/creature.cpp index cacb7ba54f6..f3ad0e5d482 100644 --- a/src/creatures/creature.cpp +++ b/src/creatures/creature.cpp @@ -2004,13 +2004,15 @@ void Creature::sendAsyncTasks() { void Creature::safeCall(std::function &&action) const { if (g_dispatcher().context().isAsync()) { - g_dispatcher().addEvent([weak_self = std::weak_ptr(shared_from_this()), action = std::move(action)] { - if (weak_self.lock()) { - action(); + g_dispatcher().addEvent([weak_self = std::weak_ptr(static_self_cast()), action = std::move(action)] { + if (const auto self = weak_self.lock()) { + if (!self->isInternalRemoved) { + action(); + } } }, g_dispatcher().context().getName()); - } else { + } else if (!isInternalRemoved) { action(); } }