cleanup and bugfixes
This commit is contained in:
parent
d439ff6d3f
commit
2ba7cfad8d
7 changed files with 20 additions and 24 deletions
|
|
@ -85,7 +85,7 @@ impl<'a> System<'a> for DefaultAI {
|
|||
Movement::RandomWaypoint { path } => {
|
||||
if let Some(path) = path {
|
||||
// We have a path - follow it
|
||||
let mut idx = map.xy_idx(pos.x, pos.y);
|
||||
let idx = map.xy_idx(pos.x, pos.y);
|
||||
if path.len() > 1 {
|
||||
if !crate::spatial::is_blocked(path[1] as usize) {
|
||||
pos.x = path[1] as i32 % map.width;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue