From 4b0b67c69a4838db836d4e73484cb27dfc016755 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Sun, 27 Nov 2022 19:39:10 -0500 Subject: [PATCH] Fix whipping input --- src/input/player.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/input/player.rs b/src/input/player.rs index f588db6..2abdb68 100644 --- a/src/input/player.rs +++ b/src/input/player.rs @@ -2,7 +2,7 @@ use instant::Instant; use std::time::Duration; use bracket_lib::prelude::*; -use hecs::{Entity, With, Without, World}; +use hecs::{Entity, Without, World}; use crate::{ components::monster::*, @@ -16,7 +16,9 @@ use crate::{ pub fn try_move(delta_x: i32, delta_y: i32, world: &mut World, resources: &mut Resources) { let mut to_kill: Vec = Vec::new(); - for (player_entity, (player, pos)) in &mut world.query::>() { + for (player_entity, (player, pos)) in + &mut world.query::>() + { let now = Instant::now(); if now - player.last_moved > Duration::from_secs_f32(PLAYER_STEP_PERIOD) { let destination = Point { @@ -271,7 +273,7 @@ fn try_step(point: Point, _world: &World, resources: &mut Resources) -> bool { pub fn whip(world: &mut World, resources: &mut Resources) { let mut to_add: Vec = Vec::new(); - for (entity, _) in world.query_mut::>>>() { + for (entity, _) in world.query_mut::>() { if resources.stats.whips > 0 { to_add.push(entity); }