diff --git a/src/player.rs b/src/player.rs index a30ba52..cb970e8 100644 --- a/src/player.rs +++ b/src/player.rs @@ -58,18 +58,16 @@ pub fn try_move_player(delta_x: i32, delta_y: i32, ecs: &mut World) { let mut ppos = ecs.write_resource::(); ppos.x = pos.x; ppos.y = pos.y - } else { - if combat_stats.get(*potential_target).is_some() { - wants_to_melee - .insert( - entity, - WantsToMelee { - target: *potential_target, - }, - ) - .expect("Add target failed"); - return; - } + } else if combat_stats.get(*potential_target).is_some() { + wants_to_melee + .insert( + entity, + WantsToMelee { + target: *potential_target, + }, + ) + .expect("Add target failed"); + return; } if let Some(door) = doors.get_mut(*potential_target) {