Skip to content

Commit

Permalink
Remove World::path_for_object()
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmytro Lysai authored and pingw33n committed Jun 11, 2020
1 parent 6da4843 commit dd0b9ab
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/game/sequence/move_seq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl Move {

fn rebuild_path(&mut self, world: &mut World) {
// TODO non-smooth
self.path = world.path_for_object(self.obj, self.to, true).unwrap_or(Vec::new());
self.path = world.objects().path(self.obj, self.to, true).unwrap_or(Vec::new());
}

fn to_point(&self, world: &World) -> Point {
Expand Down
2 changes: 1 addition & 1 deletion src/game/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,7 @@ impl AppState for GameState {
let mut wv = ui.widget_mut::<WorldView>(self.world_view);
let dude_obj = self.world.borrow().dude_obj().unwrap();
wv.hex_cursor_style = if self.world.borrow()
.path_for_object(dude_obj, PathTo::Point {
.objects().path(dude_obj, PathTo::Point {
point: pos.point,
neighbor_if_blocked: false,
}, false).is_some()
Expand Down
8 changes: 0 additions & 8 deletions src/game/world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,14 +343,6 @@ impl World {
self.objects.make_standing(h, &self.frm_db);
}

pub fn path_for_object(&self,
obj: object::Handle,
to: PathTo,
smooth: bool,
) -> Option<Vec<Direction>> {
self.objects.path(obj, to, smooth)
}

pub fn rebuild_light_grid(&mut self) {
self.light_grid.clear();
for h in self.objects.iter() {
Expand Down

0 comments on commit dd0b9ab

Please sign in to comment.