Floor coordinates so directions are consistent.
This commit is contained in:
parent
ef35478b34
commit
2ac2566f5d
|
@ -202,7 +202,10 @@ where
|
|||
}
|
||||
}
|
||||
if let Some((coordinates, _)) = target {
|
||||
commands.entity(entity).insert(Exploring(***coordinates));
|
||||
commands.entity(entity).insert(Exploring((
|
||||
coordinates.x().floor(),
|
||||
coordinates.y().floor(),
|
||||
)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -264,7 +267,7 @@ fn exploration_focus<S, A: 'static>(
|
|||
let mut exploring = if let Some(exploring) = exploring {
|
||||
**exploring
|
||||
} else {
|
||||
coordinates
|
||||
(coordinates.x().floor(), coordinates.y().floor())
|
||||
};
|
||||
let orig = exploring;
|
||||
if input.just_active(explore_forward.clone()) {
|
||||
|
@ -330,7 +333,7 @@ fn exploration_changed_announcement(
|
|||
if let Ok((coordinates, exploring)) = explorer.single() {
|
||||
let collider_set = QueryPipelineColliderComponentsSet(&collider_query);
|
||||
let coordinates = **coordinates;
|
||||
let coordinates = (coordinates.0.floor(), coordinates.1.floor());
|
||||
let coordinates = (coordinates.x().floor(), coordinates.y().floor());
|
||||
for (map, revealed_tiles, visible_tiles) in map.iter() {
|
||||
let point = **exploring;
|
||||
let idx = point.to_index(map.width);
|
||||
|
|
Loading…
Reference in New Issue
Block a user