Add chapter 2.10
This commit is contained in:
parent
f2f4c40c28
commit
a1ffc7b95d
@ -3,8 +3,8 @@ use specs::prelude::*;
|
||||
|
||||
use crate::{
|
||||
components::{Monster, Position, Viewshed, WantsToMelee},
|
||||
map::Map,
|
||||
Confusion, RunState,
|
||||
Confusion,
|
||||
map::Map, RunState,
|
||||
};
|
||||
|
||||
pub struct MonsterAI {}
|
||||
@ -43,7 +43,7 @@ impl<'a> System<'a> for MonsterAI {
|
||||
}
|
||||
|
||||
for (entity, mut viewshed, _monster, mut pos) in
|
||||
(&entities, &mut viewshed, &monster, &mut position).join()
|
||||
(&entities, &mut viewshed, &monster, &mut position).join()
|
||||
{
|
||||
let mut can_act = true;
|
||||
|
||||
@ -56,7 +56,7 @@ impl<'a> System<'a> for MonsterAI {
|
||||
}
|
||||
|
||||
if !can_act {
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
|
||||
let distance =
|
||||
|
@ -21,7 +21,7 @@ impl<'a> System<'a> for VisibilitySystem {
|
||||
let (mut map, entities, mut viewshed, pos, player) = data;
|
||||
for (ent, viewshed, pos) in (&entities, &mut viewshed, &pos).join() {
|
||||
if !viewshed.dirty {
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
|
||||
viewshed.dirty = false;
|
||||
|
Loading…
Reference in New Issue
Block a user