summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Worthe <justin@worthe-it.co.za>2018-07-21 12:22:13 +0200
committerJustin Worthe <justin@worthe-it.co.za>2018-07-21 12:22:13 +0200
commit595c1cf576677415b7d76f620e30032734d61c85 (patch)
tree164118bd56f419ab60338ee6594036bbe316e6c6
parentae2872e1e6cd367d15ff177d932088209e325e3c (diff)
Pulls a change out of a loop
-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);
}
}
}