Remove unnecessary Stolen_item_index modulo

This commit is contained in:
Kp 2016-07-10 04:11:34 +00:00
parent 71ab00beb8
commit a3766a60e3

View file

@ -1512,9 +1512,11 @@ static int attempt_to_steal_item_2(const vobjptr_t objp, const vobjptr_t player_
rval = attempt_to_steal_item_3(objp, player_num);
if (rval) {
Stolen_item_index = (Stolen_item_index+1) % MAX_STOLEN_ITEMS;
++Stolen_item_index;
if (d_rand() > 20000) // Occasionally, boost the value again
Stolen_item_index = (Stolen_item_index+1) % MAX_STOLEN_ITEMS;
++Stolen_item_index;
if (++ Stolen_item_index >= Stolen_items.size())
Stolen_item_index -= Stolen_items.size();
}
return rval;