@@ -133,9 +133,9 @@ pub fn try_move_player(delta_x: i32, delta_y: i32, ecs: &mut World) -> RunState
133133 if pos. x + delta_x < 1 || pos. x + delta_x > map. width -1 || pos. y + delta_y < 1 || pos. y + delta_y > map. height -1 { return RunState :: AwaitingInput ; }
134134 let destination_idx = map. xy_idx ( pos. x + delta_x, pos. y + delta_y) ;
135135
136- crate :: spatial:: for_each_tile_content ( destination_idx, |potential_target| {
136+ result = crate :: spatial:: for_each_tile_content_with_gamemode ( destination_idx, |potential_target| {
137137 if let Some ( _vendor) = vendors. get ( potential_target) {
138- result = RunState :: ShowVendor { vendor : potential_target, mode : VendorMode :: Sell }
138+ return Some ( RunState :: ShowVendor { vendor : potential_target, mode : VendorMode :: Sell } ) ;
139139 }
140140
141141 let mut hostile = true ;
@@ -162,7 +162,7 @@ pub fn try_move_player(delta_x: i32, delta_y: i32, ecs: &mut World) -> RunState
162162 let mut ppos = ecs. write_resource :: < Point > ( ) ;
163163 ppos. x = pos. x ;
164164 ppos. y = pos. y ;
165- result = RunState :: Ticking ;
165+ return Some ( RunState :: Ticking ) ;
166166 } else {
167167 let target = combat_stats. get ( potential_target) ;
168168 if let Some ( _target) = target {
@@ -178,8 +178,9 @@ pub fn try_move_player(delta_x: i32, delta_y: i32, ecs: &mut World) -> RunState
178178 let glyph = renderables. get_mut ( potential_target) . unwrap ( ) ;
179179 glyph. glyph = rltk:: to_cp437 ( '/' ) ;
180180 viewshed. dirty = true ;
181- result = RunState :: Ticking ;
181+ return Some ( RunState :: Ticking ) ;
182182 }
183+ None
183184 } ) ;
184185
185186 if !crate :: spatial:: is_blocked ( destination_idx) {
0 commit comments