cleanup and bugfixes

This commit is contained in:
Llywelwyn 2023-08-16 01:23:57 +01:00
parent d439ff6d3f
commit 2ba7cfad8d
7 changed files with 20 additions and 24 deletions

View file

@ -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;