From e04c11c8deb06c9c11889ea2a41b690c8cc82cff Mon Sep 17 00:00:00 2001 From: Renato Machado Date: Sun, 24 Nov 2024 21:16:17 -0300 Subject: [PATCH 1/3] Update monster.cpp --- src/creatures/monsters/monster.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/creatures/monsters/monster.cpp b/src/creatures/monsters/monster.cpp index 7276bea19d1..e0dee1e0157 100644 --- a/src/creatures/monsters/monster.cpp +++ b/src/creatures/monsters/monster.cpp @@ -354,7 +354,10 @@ void Monster::onRemoveCreature(const std::shared_ptr &creature, bool i setIdle(true); } else { - onCreatureLeave(creature); + addAsyncTask([this, creature_weak = std::weak_ptr(creature)] { + if (const auto creature = creature_weak.lock()) { + onCreatureLeave(creature); + }}); } } From 41b721453404e3c706ad987e9c9bc212f81ff924 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Mon, 25 Nov 2024 00:16:53 +0000 Subject: [PATCH 2/3] Code format - (Clang-format) --- src/creatures/monsters/monster.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/creatures/monsters/monster.cpp b/src/creatures/monsters/monster.cpp index e0dee1e0157..9dd44c61e93 100644 --- a/src/creatures/monsters/monster.cpp +++ b/src/creatures/monsters/monster.cpp @@ -357,7 +357,7 @@ void Monster::onRemoveCreature(const std::shared_ptr &creature, bool i addAsyncTask([this, creature_weak = std::weak_ptr(creature)] { if (const auto creature = creature_weak.lock()) { onCreatureLeave(creature); - }}); + } }); } } From 6f89d1dd6f1ee68388e54d4e8d15346827d233d8 Mon Sep 17 00:00:00 2001 From: Renato Machado Date: Sun, 24 Nov 2024 22:38:20 -0300 Subject: [PATCH 3/3] Update monster.cpp --- src/creatures/monsters/monster.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/creatures/monsters/monster.cpp b/src/creatures/monsters/monster.cpp index 9dd44c61e93..cb0296b5c3f 100644 --- a/src/creatures/monsters/monster.cpp +++ b/src/creatures/monsters/monster.cpp @@ -354,10 +354,9 @@ void Monster::onRemoveCreature(const std::shared_ptr &creature, bool i setIdle(true); } else { - addAsyncTask([this, creature_weak = std::weak_ptr(creature)] { - if (const auto creature = creature_weak.lock()) { - onCreatureLeave(creature); - } }); + addAsyncTask([this, creature] { + onCreatureLeave(creature); + }); } }