From 9fb6d6f8be591e936219b3dc4d86b8ffc8784c70 Mon Sep 17 00:00:00 2001 From: Renato Machado Date: Mon, 9 Dec 2024 15:52:42 -0300 Subject: [PATCH] perf: onRemoveCreature->onCreatureLeave async (#3152) the call to onCreatureLeave in Monster::onRemoveCreature will be called asynchronously. --- src/creatures/monsters/monster.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/creatures/monsters/monster.cpp b/src/creatures/monsters/monster.cpp index d59526af9cd..941aa9f13dc 100644 --- a/src/creatures/monsters/monster.cpp +++ b/src/creatures/monsters/monster.cpp @@ -355,7 +355,9 @@ void Monster::onRemoveCreature(const std::shared_ptr &creature, bool i setIdle(true); } else { - onCreatureLeave(creature); + addAsyncTask([this, creature] { + onCreatureLeave(creature); + }); } }