From ea9fff825d80e25c0949165009b4a9a68f6f8285 Mon Sep 17 00:00:00 2001 From: Andrey Lesnikov Date: Sat, 12 Nov 2016 13:28:01 +0300 Subject: [PATCH] Fixed roads again: employed object.pos.map_pos_iter in ObjectsAtIter::next --- core/src/game_state.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/game_state.rs b/core/src/game_state.rs index adc6c18..bff4fb1 100644 --- a/core/src/game_state.rs +++ b/core/src/game_state.rs @@ -22,8 +22,10 @@ impl<'a> Iterator for ObjectsAtIter<'a> { fn next(&mut self) -> Option { while let Some((_, object)) = self.it.next() { - if self.pos == object.pos.map_pos { - return Some(object); + for map_pos in object.pos.map_pos_iter() { + if self.pos == map_pos { + return Some(object); + } } } None