Skip to content

Commit 3c06283

Browse files
suphoffcinjon
authored andcommitted
Fix #87: Don't allow dropping multiple bombs on a single square
1 parent 1b662be commit 3c06283

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pommerman/forward_model.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,10 @@ def has_position_conflict(counter):
163163
if action == constants.Action.Stop.value:
164164
agent.stop()
165165
elif action == constants.Action.Bomb.value:
166-
bomb = agent.maybe_lay_bomb()
167-
if bomb:
168-
curr_bombs.append(bomb)
166+
if not utility.position_is_bomb(curr_bombs, position):
167+
bomb = agent.maybe_lay_bomb()
168+
if bomb:
169+
curr_bombs.append(bomb)
169170
elif utility.is_valid_direction(curr_board, position, action):
170171
next_position = agent.get_next_position(action)
171172

0 commit comments

Comments
 (0)