summaryrefslogtreecommitdiff
path: root/src/json.rs
diff options
context:
space:
mode:
authorJustin Worthe <justin@worthe-it.co.za>2018-06-02 14:04:06 +0200
committerJustin Worthe <justin@worthe-it.co.za>2018-06-02 14:04:06 +0200
commitb39b6c077b3df677eb877d723e279e29b2973128 (patch)
treee12a78bef9ad95f43bc3597fd3227fe5e90752df /src/json.rs
parentbb208dfdebb7dead0e7d68e837c37972498c22d5 (diff)
Made my game engine match theirs
What the hell is up with their building logic? There's +1s and dodgy indirection everywhere!
Diffstat (limited to 'src/json.rs')
-rw-r--r--src/json.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/json.rs b/src/json.rs
index a8eb012..3a3fbf2 100644
--- a/src/json.rs
+++ b/src/json.rs
@@ -151,7 +151,7 @@ impl State {
self.game_map.iter()
.flat_map(|row| row.iter()
.flat_map(|cell| cell.buildings.iter()
- .filter(|b| b.player_type == player_type && b.construction_time_left > 0)
+ .filter(|b| b.player_type == player_type && b.construction_time_left >= 0)
.map(|b| b.to_engine_unconstructed())
)
)
@@ -162,7 +162,7 @@ impl State {
self.game_map.iter()
.flat_map(|row| row.iter()
.flat_map(|cell| cell.buildings.iter()
- .filter(|b| b.player_type == player_type && b.construction_time_left <= 0)
+ .filter(|b| b.player_type == player_type && b.construction_time_left < 0)
.map(|b| b.to_engine())
)
)