From 95814fd68de4a7859ba868761728615e8aa51063 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 16 Aug 2021 17:35:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=87=AA=E5=8A=A8=E9=80=89?= =?UTF-8?q?=E6=AD=A6=E5=99=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/gameserver/creature.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/gameserver/creature.cc b/server/gameserver/creature.cc index 04bb651..785cf89 100644 --- a/server/gameserver/creature.cc +++ b/server/gameserver/creature.cc @@ -2028,6 +2028,9 @@ Weapon* Creature::ChooseNextWeapon(int curr_weapon_slot_id, int begin_slot_id, i if (slot_id >= SPEC2_IS_BEGIN && slot_id <= SPEC2_IS_END) { idx = SPEC2_SLOT_BEGIN + (slot_id - SPEC2_IS_BEGIN); } + if (slot_id >= SPEC3_IS_BEGIN && slot_id <= SPEC3_IS_END) { + idx = SPEC3_SLOT_BEGIN + (slot_id - SPEC3_IS_BEGIN); + } if (idx != -1 && weapons.at(idx).weapon_id != 0) { next_weapon = &weapons[idx]; break; @@ -2739,7 +2742,7 @@ Weapon* Creature::ChooseNextSpecWeapon(int curr_weapon_slot_id) } if (idx > -1) { for (int i = 0; i < sizeof(data) /sizeof(data[0]); ++i) { - int real_i = (i + idx) % sizeof(data) /sizeof(data[0]); + int real_i = (i + idx) % (sizeof(data) /sizeof(data[0])); int start_id = data[real_i][0]; int end_id = data[real_i][1]; int flag = data[real_i][2];