sorry - swapping from rustfmt to prettier-rust
This commit is contained in:
parent
281396f9ce
commit
c2c7e0bd52
93 changed files with 2797 additions and 2021 deletions
|
|
@ -1,4 +1,4 @@
|
|||
use crate::{EntityMoved, Map, Position, TakingTurn, Telepath, Viewshed, WantsToFlee};
|
||||
use crate::{ EntityMoved, Map, Position, TakingTurn, Telepath, Viewshed, WantsToFlee };
|
||||
use rltk::prelude::*;
|
||||
use specs::prelude::*;
|
||||
|
||||
|
|
@ -29,9 +29,13 @@ impl<'a> System<'a> for FleeAI {
|
|||
entities,
|
||||
) = data;
|
||||
let mut turn_done: Vec<Entity> = Vec::new();
|
||||
for (entity, _turn, mut pos, fleeing, mut viewshed) in
|
||||
(&entities, &turns, &mut positions, &wants_to_flee, &mut viewsheds).join()
|
||||
{
|
||||
for (entity, _turn, mut pos, fleeing, mut viewshed) in (
|
||||
&entities,
|
||||
&turns,
|
||||
&mut positions,
|
||||
&wants_to_flee,
|
||||
&mut viewsheds,
|
||||
).join() {
|
||||
turn_done.push(entity);
|
||||
let my_idx = map.xy_idx(pos.x, pos.y);
|
||||
map.populate_blocked();
|
||||
|
|
@ -44,8 +48,8 @@ impl<'a> System<'a> for FleeAI {
|
|||
if let Some(is_telepath) = telepaths.get_mut(entity) {
|
||||
is_telepath.dirty = true;
|
||||
}
|
||||
pos.x = flee_target as i32 % map.width;
|
||||
pos.y = flee_target as i32 / map.width;
|
||||
pos.x = (flee_target as i32) % map.width;
|
||||
pos.y = (flee_target as i32) / map.width;
|
||||
entity_moved.insert(entity, EntityMoved {}).expect("Unable to insert EntityMoved");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue