diff options
author | Justin Worthe <justin@worthe-it.co.za> | 2018-07-21 20:45:46 +0200 |
---|---|---|
committer | Justin Worthe <justin@worthe-it.co.za> | 2018-07-21 20:45:46 +0200 |
commit | deef6b8e3f29a6baac5c545e7f586c6fbfa437ba (patch) | |
tree | 62b4f8ad2782648921927832cd5b891bbc02f71e /src/engine/bitwise_engine.rs | |
parent | a96424cf8a90aa93edcf4e9ff11fc54800ea1b9e (diff) |
Marginally faster tesla activity update
Diffstat (limited to 'src/engine/bitwise_engine.rs')
-rw-r--r-- | src/engine/bitwise_engine.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/engine/bitwise_engine.rs b/src/engine/bitwise_engine.rs index 9dfd449..1d7e424 100644 --- a/src/engine/bitwise_engine.rs +++ b/src/engine/bitwise_engine.rs @@ -403,8 +403,8 @@ impl BitwiseGameState { } fn update_tesla_activity(buildings: &mut PlayerBuildings) { - for tesla in buildings.tesla_cooldowns.iter_mut().filter(|t| t.active) { - tesla.active = (tesla.pos.to_either_bitfield() & buildings.occupied) != 0; + for i in 0..TESLA_MAX { + buildings.tesla_cooldowns[i].active = buildings.tesla_cooldowns[i].active && (buildings.tesla_cooldowns[i].pos.to_either_bitfield() & buildings.occupied) != 0; } } |