From df858cb37027465aeff587c81980e9e8d6e55b5e Mon Sep 17 00:00:00 2001 From: timokoesters Date: Fri, 20 Mar 2020 15:45:36 +0100 Subject: [PATCH] Remove all warnings --- common/src/comp/ability.rs | 3 +-- common/src/states/basic_ranged.rs | 4 ++-- common/src/states/boost.rs | 2 +- common/src/states/dash_melee.rs | 1 - common/src/states/utils.rs | 2 +- common/src/sys/combat.rs | 1 - server/src/sys/entity_sync.rs | 4 ++-- server/src/sys/subscription.rs | 14 ++++---------- server/src/sys/terrain.rs | 2 +- voxygen/src/anim/character/attack.rs | 2 +- voxygen/src/hud/bag.rs | 2 +- voxygen/src/menu/char_selection/ui.rs | 12 ++---------- voxygen/src/scene/figure/load.rs | 2 +- voxygen/src/scene/figure/mod.rs | 10 +++------- voxygen/src/scene/simple.rs | 2 +- 15 files changed, 21 insertions(+), 42 deletions(-) diff --git a/common/src/comp/ability.rs b/common/src/comp/ability.rs index de432913fa..a7894238a6 100644 --- a/common/src/comp/ability.rs +++ b/common/src/comp/ability.rs @@ -1,11 +1,10 @@ use crate::{ - comp::{Body, CharacterState, EnergySource, Item, Projectile, StateUpdate, ToolData}, + comp::{Body, CharacterState, EnergySource, Item, Projectile, StateUpdate}, states::*, sys::character_behavior::JoinData, }; use specs::{Component, DenseVecStorage, FlaggedStorage, HashMapStorage}; use std::time::Duration; -use vek::vec::Vec3; #[derive(Clone, PartialEq, Debug, Serialize, Deserialize)] pub enum CharacterAbility { diff --git a/common/src/states/basic_ranged.rs b/common/src/states/basic_ranged.rs index e8ce491676..f2b9f3c73a 100644 --- a/common/src/states/basic_ranged.rs +++ b/common/src/states/basic_ranged.rs @@ -1,7 +1,7 @@ use crate::{ - comp::{Attacking, Body, CharacterState, EnergySource, Gravity, Projectile, StateUpdate}, + comp::{Body, CharacterState, Gravity, Projectile, StateUpdate}, event::ServerEvent, - states::{utils::*, wielding}, + states::utils::*, sys::character_behavior::*, }; use std::{collections::VecDeque, time::Duration}; diff --git a/common/src/states/boost.rs b/common/src/states/boost.rs index 7b060ed9cf..5f0f855557 100644 --- a/common/src/states/boost.rs +++ b/common/src/states/boost.rs @@ -1,6 +1,6 @@ use crate::{ comp::{Attacking, CharacterState, EnergySource, StateUpdate}, - states::{utils::*, wielding}, + states::utils::*, sys::character_behavior::*, }; use std::{collections::VecDeque, time::Duration}; diff --git a/common/src/states/dash_melee.rs b/common/src/states/dash_melee.rs index e4d495ded2..c52447218f 100644 --- a/common/src/states/dash_melee.rs +++ b/common/src/states/dash_melee.rs @@ -1,6 +1,5 @@ use crate::{ comp::{Attacking, CharacterState, EnergySource, StateUpdate}, - states::utils::*, sys::character_behavior::*, }; use std::{collections::VecDeque, time::Duration}; diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index 0ee196d5df..67eac06545 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -1,5 +1,5 @@ use crate::{ - comp::{CharacterState, EnergySource, ItemKind::Tool, StateUpdate, ToolData}, + comp::{CharacterState, ItemKind::Tool, StateUpdate, ToolData}, event::LocalEvent, states::*, sys::{character_behavior::JoinData, phys::GRAVITY}, diff --git a/common/src/sys/combat.rs b/common/src/sys/combat.rs index f6cdb6ca3d..7a910f20cd 100644 --- a/common/src/sys/combat.rs +++ b/common/src/sys/combat.rs @@ -14,7 +14,6 @@ use vek::*; const BLOCK_EFFICIENCY: f32 = 0.9; const ATTACK_RANGE: f32 = 3.5; -const ATTACK_ANGLE: f32 = 70.0; const BLOCK_ANGLE: f32 = 180.0; /// This system is responsible for handling accepted inputs like moving or diff --git a/server/src/sys/entity_sync.rs b/server/src/sys/entity_sync.rs index d499a61ec4..619458d61c 100644 --- a/server/src/sys/entity_sync.rs +++ b/server/src/sys/entity_sync.rs @@ -7,7 +7,7 @@ use crate::{ Tick, }; use common::{ - comp::{CharacterState, ForceUpdate, Inventory, InventoryUpdate, Last, Ori, Pos, Vel}, + comp::{ForceUpdate, Inventory, InventoryUpdate, Last, Ori, Pos, Vel}, msg::ServerMsg, region::{Event as RegionEvent, RegionMap}, state::TimeOfDay, @@ -112,7 +112,7 @@ impl<'a> System<'a> for Sys { continue; } let entity = entities.entity(*id); - if let Some((uid, pos, vel, ori)) = uids.get(entity).and_then(|uid| { + if let Some((_uid, pos, vel, ori)) = uids.get(entity).and_then(|uid| { positions.get(entity).map(|pos| { (uid, pos, velocities.get(entity), orientations.get(entity)) }) diff --git a/server/src/sys/subscription.rs b/server/src/sys/subscription.rs index 07a8a15315..36a2a64b9c 100644 --- a/server/src/sys/subscription.rs +++ b/server/src/sys/subscription.rs @@ -4,7 +4,7 @@ use super::{ }; use crate::client::{self, Client, RegionSubscription}; use common::{ - comp::{CharacterState, Ori, Player, Pos, Vel}, + comp::{Ori, Player, Pos, Vel}, msg::ServerMsg, region::{region_in_vd, regions_in_vd, Event as RegionEvent, RegionMap}, sync::Uid, @@ -29,7 +29,6 @@ impl<'a> System<'a> for Sys { ReadStorage<'a, Pos>, ReadStorage<'a, Vel>, ReadStorage<'a, Ori>, - ReadStorage<'a, CharacterState>, ReadStorage<'a, Player>, WriteStorage<'a, Client>, WriteStorage<'a, RegionSubscription>, @@ -47,7 +46,6 @@ impl<'a> System<'a> for Sys { positions, velocities, orientations, - character_states, players, mut clients, mut subscriptions, @@ -182,17 +180,15 @@ impl<'a> System<'a> for Sys { // already within the set of subscribed regions if subscription.regions.insert(key.clone()) { if let Some(region) = region_map.get(key) { - for (uid, pos, vel, ori, character_state, _, entity) in ( - &uids, + for (pos, vel, ori, _, entity) in ( &positions, velocities.maybe(), orientations.maybe(), - character_states.maybe(), region.entities(), &entities, ) .join() - .filter(|(_, _, _, _, _, _, e)| *e != client_entity) + .filter(|(_, _, _, _, e)| *e != client_entity) { // Send message to create entity and tracked components and physics // components @@ -239,12 +235,10 @@ pub fn initialize_region_subscription(world: &World, entity: specs::Entity) { let tracked_comps = TrackedComps::fetch(world); for key in ®ions { if let Some(region) = region_map.get(*key) { - for (uid, pos, vel, ori, character_state, _, entity) in ( - &tracked_comps.uid, + for (pos, vel, ori, _, entity) in ( &world.read_storage::(), // We assume all these entities have a position world.read_storage::().maybe(), world.read_storage::().maybe(), - world.read_storage::().maybe(), region.entities(), &world.entities(), ) diff --git a/server/src/sys/terrain.rs b/server/src/sys/terrain.rs index 0265f63311..f47a4e7a08 100644 --- a/server/src/sys/terrain.rs +++ b/server/src/sys/terrain.rs @@ -2,7 +2,7 @@ use super::SysTimer; use crate::{chunk_generator::ChunkGenerator, client::Client, Tick}; use common::{ assets, - comp::{self, humanoid, item, CharacterAbility, Item, ItemConfig, Player, Pos}, + comp::{self, CharacterAbility, Item, ItemConfig, Player, Pos}, event::{EventBus, ServerEvent}, generation::EntityKind, msg::ServerMsg, diff --git a/voxygen/src/anim/character/attack.rs b/voxygen/src/anim/character/attack.rs index b866629bbf..767b6dfa9d 100644 --- a/voxygen/src/anim/character/attack.rs +++ b/voxygen/src/anim/character/attack.rs @@ -23,7 +23,7 @@ impl Animation for AttackAnimation { let mut next = (*skeleton).clone(); let lab = 1.0; - let test = (anim_time as f32 * 16.0 * lab as f32).cos(); + //let test = (anim_time as f32 * 16.0 * lab as f32).cos(); let accel_med = 1.0 - (anim_time as f32 * 16.0 * lab as f32).cos(); let accel_slow = 1.0 - (anim_time as f32 * 12.0 * lab as f32).cos(); diff --git a/voxygen/src/hud/bag.rs b/voxygen/src/hud/bag.rs index d2fe381091..82db8367f5 100644 --- a/voxygen/src/hud/bag.rs +++ b/voxygen/src/hud/bag.rs @@ -8,7 +8,7 @@ use crate::{ ui::{fonts::ConrodVoxygenFonts, ImageFrame, Tooltip, TooltipManager, Tooltipable}, }; use client::Client; -use common::comp::{item, ItemKind, Stats}; +use common::comp::{ItemKind, Stats}; use conrod_core::{ color, image, widget::{self, Button, Image, Rectangle, Text}, diff --git a/voxygen/src/menu/char_selection/ui.rs b/voxygen/src/menu/char_selection/ui.rs index f9cfa9efdd..bbeeb524dc 100644 --- a/voxygen/src/menu/char_selection/ui.rs +++ b/voxygen/src/menu/char_selection/ui.rs @@ -320,10 +320,7 @@ impl CharSelectionUi { match &self.mode { Mode::Select(data) => data.clone(), Mode::Create { - name, - body, - loadout, - tool, + name, body, tool, .. } => Some(CharacterData { name: name.clone(), body: comp::Body::Humanoid(body.clone()), @@ -335,12 +332,7 @@ impl CharSelectionUi { pub fn get_loadout(&mut self) -> Option<&comp::Loadout> { match &mut self.mode { Mode::Select(_) => None, - Mode::Create { - name, - body, - loadout, - tool, - } => { + Mode::Create { loadout, tool, .. } => { loadout.active_item = tool.map(|tool| comp::ItemConfig { item: (*load_expect::(tool)).clone(), primary_ability: None, diff --git a/voxygen/src/scene/figure/load.rs b/voxygen/src/scene/figure/load.rs index 75758fdbe1..e27532161e 100644 --- a/voxygen/src/scene/figure/load.rs +++ b/voxygen/src/scene/figure/load.rs @@ -18,7 +18,7 @@ use common::{ object, quadruped_medium::{BodyType as QMBodyType, Species as QMSpecies}, quadruped_small::{BodyType as QSBodyType, Species as QSSpecies}, - Item, ItemKind, Loadout, + ItemKind, Loadout, }, figure::{DynaUnionizer, MatSegment, Material, Segment}, }; diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index aca487e7c2..49718623cd 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -20,8 +20,7 @@ use crate::{ }; use common::{ comp::{ - Body, CharacterState, ItemKind, Last, Loadout, Ori, PhysicsState, Pos, Scale, Stats, - ToolData, Vel, + Body, CharacterState, ItemKind, Last, Loadout, Ori, PhysicsState, Pos, Scale, Stats, Vel, }, state::State, terrain::TerrainChunk, @@ -1370,7 +1369,7 @@ impl FigureMgr { let character_state_storage = state.read_storage::(); let character_state = character_state_storage.get(player_entity); - for (entity, _, _, body, stats, loadout, _) in ( + for (entity, _, _, body, _, loadout, _) in ( &ecs.entities(), &ecs.read_storage::(), ecs.read_storage::().maybe(), @@ -1381,7 +1380,7 @@ impl FigureMgr { ) .join() // Don't render dead entities - .filter(|(_, _, _, _, stats, loadout, _)| stats.map_or(true, |s| !s.is_dead)) + .filter(|(_, _, _, _, stats, _, _)| stats.map_or(true, |s| !s.is_dead)) { let is_player = entity == player_entity; let player_camera_mode = if is_player { @@ -1389,9 +1388,6 @@ impl FigureMgr { } else { CameraMode::default() }; - let active_item_kind = loadout - .and_then(|l| l.active_item.as_ref()) - .map(|i| &i.item.kind); let character_state = if is_player { character_state } else { None }; let FigureMgr { diff --git a/voxygen/src/scene/simple.rs b/voxygen/src/scene/simple.rs index 112f9ba565..abb47585fc 100644 --- a/voxygen/src/scene/simple.rs +++ b/voxygen/src/scene/simple.rs @@ -15,7 +15,7 @@ use crate::{ window::{Event, PressState}, }; use common::{ - comp::{humanoid, Body, ItemKind, Loadout}, + comp::{humanoid, Body, Loadout}, terrain::BlockKind, vol::{BaseVol, ReadVol, Vox}, };