Skip to content

Commit

Permalink
fix: prevent crash in pathfinder async (#2742)
Browse files Browse the repository at this point in the history
  • Loading branch information
mehah committed Jul 11, 2024
1 parent ff686d7 commit b799436
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/creatures/creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1050,6 +1050,10 @@ void Creature::goToFollowCreature_async(std::function<void()> &&onComplete) {

pathfinderRunning.store(true);
g_dispatcher().asyncEvent([self = getCreature()] {
if (!self || self->isRemoved()) {
return;
}

self->goToFollowCreature();
self->pathfinderRunning.store(false);
});
Expand Down

0 comments on commit b799436

Please sign in to comment.