summaryrefslogtreecommitdiff
path: root/src/game.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.rs')
-rw-r--r--src/game.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/game.rs b/src/game.rs
index 56c583b..4e074ea 100644
--- a/src/game.rs
+++ b/src/game.rs
@@ -320,6 +320,8 @@ impl GameBoard {
// TODO: Destroy health packs
+ let map_clone = self.map.clone();
+
// TODO: iter, filter_map, filter, filter_map... flatten this block down a smidge.
for player_index in 0..actions.len() {
if let Action::Bomb(p) = actions[player_index] {
@@ -333,9 +335,8 @@ impl GameBoard {
for &(damage_offset, weapon_damage) in BOMB_DAMAGES.iter() {
let target = p + damage_offset;
- if self.map.at(target) == Some(true) {
+ if map_clone.at(target) == Some(true) {
self.map.clear(target);
- // TODO: Fix this so that simultaneous bomb throwing gives points to both players
self.players[player_index].moves_score += DIG_SCORE;
}