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);