Add chapter 2.10

This commit is contained in:
Kasper Juul Hermansen 2022-01-27 20:14:25 +01:00
parent f2f4c40c28
commit a1ffc7b95d
Signed by: kjuulh
GPG Key ID: 0F95C140730F2F23
2 changed files with 5 additions and 5 deletions

View File

@ -3,8 +3,8 @@ use specs::prelude::*;
use crate::{ use crate::{
components::{Monster, Position, Viewshed, WantsToMelee}, components::{Monster, Position, Viewshed, WantsToMelee},
map::Map, Confusion,
Confusion, RunState, map::Map, RunState,
}; };
pub struct MonsterAI {} pub struct MonsterAI {}
@ -43,7 +43,7 @@ impl<'a> System<'a> for MonsterAI {
} }
for (entity, mut viewshed, _monster, mut pos) in 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; let mut can_act = true;
@ -56,7 +56,7 @@ impl<'a> System<'a> for MonsterAI {
} }
if !can_act { if !can_act {
return; continue;
} }
let distance = let distance =

View File

@ -21,7 +21,7 @@ impl<'a> System<'a> for VisibilitySystem {
let (mut map, entities, mut viewshed, pos, player) = data; let (mut map, entities, mut viewshed, pos, player) = data;
for (ent, viewshed, pos) in (&entities, &mut viewshed, &pos).join() { for (ent, viewshed, pos) in (&entities, &mut viewshed, &pos).join() {
if !viewshed.dirty { if !viewshed.dirty {
return; continue;
} }
viewshed.dirty = false; viewshed.dirty = false;