summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/engine/bitwise_engine.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/engine/bitwise_engine.rs b/src/engine/bitwise_engine.rs
index dd9ba93..99e4d92 100644
--- a/src/engine/bitwise_engine.rs
+++ b/src/engine/bitwise_engine.rs
@@ -309,13 +309,13 @@ impl BitwiseGameState {
let top_row_mask = 255u64 << (top_row * SINGLE_MAP_WIDTH);
let mut destroy_mask = top_row_mask.wrapping_shl(missed_cells) & top_row_mask;
+ let mut hits = 0;
for _ in 0..(if tesla.pos.y == 0 || tesla.pos.y == MAP_HEIGHT-1 { 2 } else { 3 }) {
- let hits = destroy_mask & opponent_buildings.buildings[0];
+ hits |= destroy_mask & opponent_buildings.buildings[0];
destroy_mask &= !hits;
- //TODO: This can probably be pulled out of the loop
- BitwiseGameState::destroy_buildings(opponent_buildings, hits);
destroy_mask = destroy_mask << SINGLE_MAP_WIDTH;
}
+ BitwiseGameState::destroy_buildings(opponent_buildings, hits);
}
}
}