Fix wall drawing bug and get rid of clippy warnings
This commit is contained in:
parent
a198fe1832
commit
c4bc637c79
@ -209,6 +209,7 @@ pub fn show_inventory(gs: &mut State, ctx: &mut Rltk) -> (ItemMenuResult, Option
|
||||
|
||||
let mut equippable: Vec<Entity> = Vec::new();
|
||||
let mut j = 0;
|
||||
#[allow(clippy::explicit_counter_loop)]
|
||||
for (entity, _pack, name) in (&entities, &backpack, &names)
|
||||
.join()
|
||||
.filter(|item| item.1.owner == *player_entity)
|
||||
@ -296,6 +297,7 @@ pub fn drop_item_menu(gs: &mut State, ctx: &mut Rltk) -> (ItemMenuResult, Option
|
||||
|
||||
let mut equippable: Vec<Entity> = Vec::new();
|
||||
let mut j = 0;
|
||||
#[allow(clippy::explicit_counter_loop)]
|
||||
for (entity, _pack, name) in (&entities, &backpack, &names)
|
||||
.join()
|
||||
.filter(|item| item.1.owner == *player_entity)
|
||||
@ -383,6 +385,7 @@ pub fn remove_item_menu(gs: &mut State, ctx: &mut Rltk) -> (ItemMenuResult, Opti
|
||||
|
||||
let mut equippable: Vec<Entity> = Vec::new();
|
||||
let mut j = 0;
|
||||
#[allow(clippy::explicit_counter_loop)]
|
||||
for (entity, _pack, name) in (&entities, &backpack, &names)
|
||||
.join()
|
||||
.filter(|item| item.1.owner == *player_entity)
|
||||
|
@ -261,7 +261,7 @@ pub fn draw_map(ecs: &World, ctx: &mut Rltk) {
|
||||
}
|
||||
|
||||
fn wall_glyph(map: &Map, x: i32, y: i32) -> rltk::FontCharType {
|
||||
if x < 1 || x > map.width - 1 || y < 1 || y > map.height - 1 as i32 {
|
||||
if x < 1 || x > map.width - 2 || y < 1 || y > map.height - 2 {
|
||||
return 35;
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ impl<'a> System<'a> for MonsterAI {
|
||||
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,
|
||||
&*map,
|
||||
);
|
||||
|
||||
if path.success && path.steps.len() > 1 {
|
||||
|
@ -92,7 +92,7 @@ macro_rules! deserialize_individually {
|
||||
$(
|
||||
DeserializeComponents::<NoError, _>::deserialize(
|
||||
&mut ( &mut $ecs.write_storage::<$type>(), ),
|
||||
&mut $data.0, // entities
|
||||
&$data.0, // entities
|
||||
&mut $data.1, // marker
|
||||
&mut $data.2, // allocater
|
||||
&mut $de,
|
||||
|
Loading…
Reference in New Issue
Block a user