Remove all warnings

This commit is contained in:
timokoesters 2020-03-20 15:45:36 +01:00
parent 3ec2cc08b3
commit df858cb370
15 changed files with 21 additions and 42 deletions

View File

@ -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 {

View File

@ -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};

View File

@ -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};

View File

@ -1,6 +1,5 @@
use crate::{
comp::{Attacking, CharacterState, EnergySource, StateUpdate},
states::utils::*,
sys::character_behavior::*,
};
use std::{collections::VecDeque, time::Duration};

View File

@ -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},

View File

@ -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

View File

@ -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))
})

View File

@ -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 &regions {
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::<Pos>(), // We assume all these entities have a position
world.read_storage::<Vel>().maybe(),
world.read_storage::<Ori>().maybe(),
world.read_storage::<CharacterState>().maybe(),
region.entities(),
&world.entities(),
)

View File

@ -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,

View File

@ -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();

View File

@ -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},

View File

@ -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::<comp::Item>(tool)).clone(),
primary_ability: None,

View File

@ -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},
};

View File

@ -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::<common::comp::CharacterState>();
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::<Pos>(),
ecs.read_storage::<Ori>().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 {

View File

@ -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},
};