Skip to content

Commit

Permalink
perf: onRemoveCreature->onCreatureLeave async (#3152)
Browse files Browse the repository at this point in the history
the call to onCreatureLeave in Monster::onRemoveCreature will be called
asynchronously.
  • Loading branch information
mehah authored Dec 9, 2024
1 parent 3c98b41 commit 74b8ed0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/creatures/monsters/monster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,9 @@ void Monster::onRemoveCreature(const std::shared_ptr<Creature> &creature, bool i

setIdle(true);
} else {
onCreatureLeave(creature);
addAsyncTask([this, creature] {
onCreatureLeave(creature);
});
}
}

Expand Down

0 comments on commit 74b8ed0

Please sign in to comment.