diff --git a/server/gameserver/creature.cc b/server/gameserver/creature.cc index 42e5114..21a1286 100644 --- a/server/gameserver/creature.cc +++ b/server/gameserver/creature.cc @@ -2033,6 +2033,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; @@ -2744,7 +2747,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];