after 12 bombs we couldn't set any other new bomb

origin
stpohle 23 years ago
parent 37bfb05729
commit 3bcd31c102

@ -763,7 +763,7 @@ int player_findfreebomb (_player *player) {
exploded bomb to the last exploded bomb */ exploded bomb to the last exploded bomb */
for (i = player->bomb_lastex + 1; (bombused < player->bombs_n && i != player->bomb_lastex && res == -1); i++) { for (i = player->bomb_lastex + 1; (bombused < player->bombs_n && i != player->bomb_lastex && res == -1); i++) {
if (i < 0 || i > MAX_BOMBS) // i out of range .. restart at bomb 0 if (i < 0 || i >= MAX_BOMBS) // i out of range .. restart at bomb 0
i = 0; i = 0;
if (player->bombs[i].state == BS_off) if (player->bombs[i].state == BS_off)
res = i; res = i;
@ -771,5 +771,8 @@ int player_findfreebomb (_player *player) {
bombused++; // count number of used bombs bombused++; // count number of used bombs
} }
if (res == -1 && i == player->bomb_lastex && player->bombs[i].state == BS_off)
res = i;
return res; return res;
}; };

Loading…
Cancel
Save