Skip to content

Commit

Permalink
Fixed roads again: employed object.pos.map_pos_iter in ObjectsAtIter:…
Browse files Browse the repository at this point in the history
…:next
  • Loading branch information
ozkriff committed Nov 12, 2016
1 parent ebabe8b commit ea9fff8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/src/game_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ impl<'a> Iterator for ObjectsAtIter<'a> {

fn next(&mut self) -> Option<Self::Item> {
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
Expand Down

0 comments on commit ea9fff8

Please sign in to comment.