From 3bcd31c1023db0245c5dc9237345756e331ec089 Mon Sep 17 00:00:00 2001 From: stpohle Date: Sun, 22 Jun 2003 02:26:39 +0000 Subject: [PATCH] after 12 bombs we couldn't set any other new bomb --- src/player.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/player.c b/src/player.c index 231fdfa..fb957b3 100644 --- a/src/player.c +++ b/src/player.c @@ -763,7 +763,7 @@ int player_findfreebomb (_player *player) { exploded bomb to the last exploded bomb */ 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; if (player->bombs[i].state == BS_off) res = i; @@ -771,5 +771,8 @@ int player_findfreebomb (_player *player) { bombused++; // count number of used bombs } + if (res == -1 && i == player->bomb_lastex && player->bombs[i].state == BS_off) + res = i; + return res; };