Skip to content

Commit

Permalink
perf: onRemoveCreature->onCreatureLeave async (opentibiabr#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 and feliphechaves committed Jan 14, 2025
1 parent ac9e13c commit 9fb6d6f
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 @@ -355,7 +355,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 9fb6d6f

Please sign in to comment.