From 774add572d48c4d505f359ea9b519f040e33c701 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 16 Aug 2021 14:04:47 +0800 Subject: [PATCH] 1 --- server/gameserver/creature.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/gameserver/creature.cc b/server/gameserver/creature.cc index 66b7f57..5269fb9 100644 --- a/server/gameserver/creature.cc +++ b/server/gameserver/creature.cc @@ -2639,9 +2639,14 @@ void Creature::AutoSwitchWeapon() *c->GetCurrWeapon() = Weapon(); c->GetCurrWeapon()->weapon_idx = weapon_idx; Weapon* next_weapon = c->ChooseNextSpecWeapon(slot_id); + if (!next_weapon) { + next_weapon = c->AutoChgWeapon(); + } if (next_weapon) { c->SetCurrWeapon(next_weapon); switch_ok = true; + } else { + abort(); } } }