From bb4029a9bfb455f0772ff106055b888d4fe8b568 Mon Sep 17 00:00:00 2001 From: dongresource Date: Sun, 19 Sep 2021 04:20:24 +0200 Subject: [PATCH] Fix invisible group mobs bug This is a simplified adaptation of 29e7bd25a4f888e9d72fa01f84df98de79f861d1 from Retrobution. Co-authored-by: Jade --- src/MobAI.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/MobAI.cpp b/src/MobAI.cpp index a7cbb8a..c31e19c 100644 --- a/src/MobAI.cpp +++ b/src/MobAI.cpp @@ -98,11 +98,17 @@ void MobAI::groupRetreat(Mob *mob) { } Mob* followerMob = (Mob*)NPCManager::NPCs[leadMob->groupMember[i]]; + if (followerMob->state != MobState::COMBAT) + continue; + followerMob->target = nullptr; followerMob->state = MobState::RETREAT; clearDebuff(followerMob); } + if (leadMob->state != MobState::COMBAT) + return; + leadMob->target = nullptr; leadMob->state = MobState::RETREAT; clearDebuff(leadMob);