From b39b6c077b3df677eb877d723e279e29b2973128 Mon Sep 17 00:00:00 2001 From: Justin Worthe Date: Sat, 2 Jun 2018 14:04:06 +0200 Subject: Made my game engine match theirs What the hell is up with their building logic? There's +1s and dodgy indirection everywhere! --- src/json.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/json.rs') 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()) ) ) -- cgit v1.2.3