gui, inventory, symmetrical shadowcasting, bugfixes

This commit is contained in:
Llywelwyn 2023-07-07 07:10:44 +01:00
parent 5b7eac3165
commit 986adb6fce
10 changed files with 355 additions and 71 deletions

View file

@ -42,11 +42,7 @@ impl<'a> System<'a> for MonsterAI {
.insert(entity, WantsToMelee { target: *player_entity })
.expect("Unable to insert attack.");
} else if viewshed.visible_tiles.contains(&*player_pos) {
let path = rltk::a_star_search(
map.xy_idx(pos.x, pos.y) as i32,
map.xy_idx(player_pos.x, player_pos.y) as i32,
&mut *map,
);
let path = rltk::a_star_search(map.xy_idx(pos.x, pos.y), map.xy_idx(player_pos.x, player_pos.y), &*map);
if path.success && path.steps.len() > 1 {
let mut idx = map.xy_idx(pos.x, pos.y);
map.blocked[idx] = false;