Skip to content

Commit

Permalink
Update monster.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
mehah committed Nov 25, 2024
1 parent 41b7214 commit 6f89d1d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/creatures/monsters/monster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,9 @@ void Monster::onRemoveCreature(const std::shared_ptr<Creature> &creature, bool i

setIdle(true);
} else {
addAsyncTask([this, creature_weak = std::weak_ptr<Creature>(creature)] {
if (const auto creature = creature_weak.lock()) {
onCreatureLeave(creature);
} });
addAsyncTask([this, creature] {
onCreatureLeave(creature);
});
}
}

Expand Down

0 comments on commit 6f89d1d

Please sign in to comment.