From 2ac2566f5d54a3274a1d185979df800a78748d04 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Mon, 27 Sep 2021 09:57:21 -0500 Subject: [PATCH] Floor coordinates so directions are consistent. --- src/exploration.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/exploration.rs b/src/exploration.rs index 713ff43..92cfef1 100644 --- a/src/exploration.rs +++ b/src/exploration.rs @@ -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( 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);