gui, inventory, symmetrical shadowcasting, bugfixes
This commit is contained in:
parent
5b7eac3165
commit
986adb6fce
10 changed files with 355 additions and 71 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue