1
This commit is contained in:
commit
5b61f17ca1
@ -1431,8 +1431,15 @@ Weapon* Creature::ChooseNextWeapon(int curr_weapon_slot_id, int begin_slot_id, i
|
|||||||
for (int i = 1; i <= (end_slot_id - begin_slot_id); ++i) {
|
for (int i = 1; i <= (end_slot_id - begin_slot_id); ++i) {
|
||||||
int slot_id = begin_slot_id +
|
int slot_id = begin_slot_id +
|
||||||
(i + curr_weapon_slot_id - begin_slot_id) % (end_slot_id - begin_slot_id + 1);
|
(i + curr_weapon_slot_id - begin_slot_id) % (end_slot_id - begin_slot_id + 1);
|
||||||
if (weapons[slot_id].weapon_id != 0) {
|
int idx = -1;
|
||||||
next_weapon = &weapons[slot_id];
|
if (slot_id >= SPEC1_IS_BEGIN && slot_id <= SPEC1_IS_END) {
|
||||||
|
idx = SPEC1_SLOT_BEGIN + (slot_id - SPEC1_IS_BEGIN);
|
||||||
|
}
|
||||||
|
if (slot_id >= SPEC2_IS_BEGIN && slot_id <= SPEC2_IS_END) {
|
||||||
|
idx = SPEC2_SLOT_BEGIN + (slot_id - SPEC2_IS_BEGIN);
|
||||||
|
}
|
||||||
|
if (idx != -1 && weapons.at(idx).weapon_id != 0) {
|
||||||
|
next_weapon = &weapons[idx];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user