Assorted small changes.
This commit is contained in:
parent
10bf503c89
commit
a214206caf
|
@ -333,7 +333,7 @@ fn exploration_changed_announcement(
|
||||||
query_pipeline: Res<QueryPipeline>,
|
query_pipeline: Res<QueryPipeline>,
|
||||||
collider_query: QueryPipelineColliderComponentsQuery,
|
collider_query: QueryPipelineColliderComponentsQuery,
|
||||||
) -> Result<(), Box<dyn Error>> {
|
) -> Result<(), Box<dyn Error>> {
|
||||||
let (coordinates, exploring, viewshed) = explorer.single();
|
if let Ok((coordinates, exploring, viewshed)) = explorer.get_single() {
|
||||||
let collider_set = QueryPipelineColliderComponentsSet(&collider_query);
|
let collider_set = QueryPipelineColliderComponentsSet(&collider_query);
|
||||||
let coordinates = coordinates.floor();
|
let coordinates = coordinates.floor();
|
||||||
for (map, revealed_tiles) in map.iter() {
|
for (map, revealed_tiles) in map.iter() {
|
||||||
|
@ -393,6 +393,7 @@ fn exploration_changed_announcement(
|
||||||
}
|
}
|
||||||
tts.speak(tokens.join(", ").to_string(), true)?;
|
tts.speak(tokens.join(", ").to_string(), true)?;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,8 +22,8 @@ impl From<mapgen::geometry::Point> for Coordinates {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Component, Clone, Debug, Deref, DerefMut)]
|
#[derive(Component, Copy, Clone, Debug, Deref, DerefMut, PartialEq)]
|
||||||
pub struct Area(AABB);
|
pub struct Area(pub AABB);
|
||||||
|
|
||||||
#[derive(Component, Clone, Default, Deref, DerefMut)]
|
#[derive(Component, Clone, Default, Deref, DerefMut)]
|
||||||
pub struct Map(pub MapgenMap);
|
pub struct Map(pub MapgenMap);
|
||||||
|
|
|
@ -195,9 +195,10 @@ fn speak_direction(
|
||||||
mut tts: ResMut<Tts>,
|
mut tts: ResMut<Tts>,
|
||||||
player: Query<&CardinalDirection, (With<Player>, Changed<CardinalDirection>)>,
|
player: Query<&CardinalDirection, (With<Player>, Changed<CardinalDirection>)>,
|
||||||
) -> Result<(), Box<dyn Error>> {
|
) -> Result<(), Box<dyn Error>> {
|
||||||
let direction = player.single();
|
if let Ok(direction) = player.get_single() {
|
||||||
let direction: String = (*direction).into();
|
let direction: String = (*direction).into();
|
||||||
tts.speak(direction, true)?;
|
tts.speak(direction, true)?;
|
||||||
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -281,7 +281,7 @@ fn update_viewshed(
|
||||||
if let Ok((viewer_entity, mut viewshed, mut visible_entities, viewer_coordinates)) =
|
if let Ok((viewer_entity, mut viewshed, mut visible_entities, viewer_coordinates)) =
|
||||||
viewers.get_mut(*entity)
|
viewers.get_mut(*entity)
|
||||||
{
|
{
|
||||||
let map = map.single();
|
if let Ok(map) = map.get_single() {
|
||||||
let mut cache = HashMap::new();
|
let mut cache = HashMap::new();
|
||||||
viewshed.update(
|
viewshed.update(
|
||||||
&viewer_entity,
|
&viewer_entity,
|
||||||
|
@ -296,6 +296,7 @@ fn update_viewshed(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn remove_visible(
|
fn remove_visible(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user