mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Clean up warnings
This commit is contained in:
parent
54a7112ad9
commit
49c7143144
@ -67,7 +67,7 @@ impl Input {
|
|||||||
|
|
||||||
/// Whether input has been pressed for longer than `threshold`
|
/// Whether input has been pressed for longer than `threshold`
|
||||||
pub fn is_long_press(&self, threshold: Duration) -> bool {
|
pub fn is_long_press(&self, threshold: Duration) -> bool {
|
||||||
(self.is_pressed() && self.duration >= threshold)
|
self.is_pressed() && self.duration >= threshold
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Handles logic of updating state of Input
|
/// Handles logic of updating state of Input
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
comp::{
|
comp::{
|
||||||
AbilityPool, Body, CharacterState, Controller, ControllerInputs, Energy, Mounting, Ori,
|
AbilityPool, Body, CharacterState, Controller, ControllerInputs, Energy, Mounting, Ori,
|
||||||
PhysicsState, Pos, StateUpdate, Stats, Vel,
|
PhysicsState, Pos, Stats, Vel,
|
||||||
},
|
},
|
||||||
event::{EventBus, LocalEvent, ServerEvent},
|
event::{EventBus, LocalEvent, ServerEvent},
|
||||||
state::DeltaTime,
|
state::DeltaTime,
|
||||||
@ -11,7 +11,7 @@ use crate::{
|
|||||||
|
|
||||||
use specs::{Entities, Entity, Join, LazyUpdate, Read, ReadStorage, System, WriteStorage};
|
use specs::{Entities, Entity, Join, LazyUpdate, Read, ReadStorage, System, WriteStorage};
|
||||||
|
|
||||||
use std::collections::VecDeque;
|
// use std::collections::VecDeque;
|
||||||
|
|
||||||
/// Read-Only Data sent from Character Behavior System to bahvior fn's
|
/// Read-Only Data sent from Character Behavior System to bahvior fn's
|
||||||
pub struct JoinData<'a> {
|
pub struct JoinData<'a> {
|
||||||
@ -171,15 +171,15 @@ impl<'a> System<'a> for Sys {
|
|||||||
CharacterState::BasicBlock { .. } => states::basic_block::behavior(&j),
|
CharacterState::BasicBlock { .. } => states::basic_block::behavior(&j),
|
||||||
CharacterState::Sit { .. } => states::sit::behavior(&j),
|
CharacterState::Sit { .. } => states::sit::behavior(&j),
|
||||||
|
|
||||||
_ => StateUpdate {
|
// _ => StateUpdate {
|
||||||
character: *j.character,
|
// character: *j.character,
|
||||||
pos: *j.pos,
|
// pos: *j.pos,
|
||||||
vel: *j.vel,
|
// vel: *j.vel,
|
||||||
ori: *j.ori,
|
// ori: *j.ori,
|
||||||
energy: *j.energy,
|
// energy: *j.energy,
|
||||||
local_events: VecDeque::new(),
|
// local_events: VecDeque::new(),
|
||||||
server_events: VecDeque::new(),
|
// server_events: VecDeque::new(),
|
||||||
},
|
// },
|
||||||
};
|
};
|
||||||
|
|
||||||
*tuple.2 = state_update.character;
|
*tuple.2 = state_update.character;
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
comp::{
|
comp::{
|
||||||
Attacking, Body, CharacterState, Controller, HealthChange, HealthSource, Item, ItemKind,
|
Attacking, Body, CharacterState, Controller, HealthChange, HealthSource, Ori, Pos, Scale,
|
||||||
Ori, Pos, Scale, Stats,
|
Stats,
|
||||||
},
|
},
|
||||||
event::{EventBus, LocalEvent, ServerEvent},
|
event::{EventBus, LocalEvent, ServerEvent},
|
||||||
state::DeltaTime,
|
state::DeltaTime,
|
||||||
sync::Uid,
|
sync::Uid,
|
||||||
};
|
};
|
||||||
use specs::{Entities, Join, Read, ReadStorage, System, WriteStorage};
|
use specs::{Entities, Join, Read, ReadStorage, System, WriteStorage};
|
||||||
use std::time::Duration;
|
// use std::time::Duration;
|
||||||
use vek::*;
|
use vek::*;
|
||||||
|
|
||||||
const BLOCK_EFFICIENCY: f32 = 0.9;
|
const BLOCK_EFFICIENCY: f32 = 0.9;
|
||||||
@ -42,8 +42,8 @@ impl<'a> System<'a> for Sys {
|
|||||||
(
|
(
|
||||||
entities,
|
entities,
|
||||||
server_bus,
|
server_bus,
|
||||||
local_bus,
|
_local_bus,
|
||||||
dt,
|
_dt,
|
||||||
uids,
|
uids,
|
||||||
positions,
|
positions,
|
||||||
orientations,
|
orientations,
|
||||||
@ -52,11 +52,11 @@ impl<'a> System<'a> for Sys {
|
|||||||
bodies,
|
bodies,
|
||||||
stats,
|
stats,
|
||||||
mut attacking_storage,
|
mut attacking_storage,
|
||||||
mut character_states,
|
character_states,
|
||||||
): Self::SystemData,
|
): Self::SystemData,
|
||||||
) {
|
) {
|
||||||
// Attacks
|
// Attacks
|
||||||
for (entity, uid, pos, ori, scale_maybe, _, attacker_stats, attack) in (
|
for (entity, uid, pos, ori, scale_maybe, _, _attacker_stats, attack) in (
|
||||||
&entities,
|
&entities,
|
||||||
&uids,
|
&uids,
|
||||||
&positions,
|
&positions,
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
comp::{
|
comp::{ControlEvent, Controller},
|
||||||
item, projectile, Body, ControlEvent, Controller, ControllerInputs, Energy, EnergySource,
|
event::{EventBus, LocalEvent, ServerEvent},
|
||||||
HealthChange, HealthSource, ItemKind, Mounting, PhysicsState, Projectile, Stats, Vel,
|
|
||||||
},
|
|
||||||
event::{Emitter, EventBus, LocalEvent, ServerEvent},
|
|
||||||
state::DeltaTime,
|
state::DeltaTime,
|
||||||
sync::{Uid, UidAllocator},
|
sync::{Uid, UidAllocator},
|
||||||
};
|
};
|
||||||
@ -12,8 +9,8 @@ use specs::{
|
|||||||
Entities, Join, Read, ReadStorage, System, WriteStorage,
|
Entities, Join, Read, ReadStorage, System, WriteStorage,
|
||||||
};
|
};
|
||||||
|
|
||||||
const CHARGE_COST: i32 = 200;
|
// const CHARGE_COST: i32 = 200;
|
||||||
const ROLL_COST: i32 = 30;
|
// const ROLL_COST: i32 = 30;
|
||||||
|
|
||||||
pub struct Sys;
|
pub struct Sys;
|
||||||
|
|
||||||
|
@ -58,6 +58,9 @@ pub trait Skeleton: Send + Sync + 'static {
|
|||||||
fn interpolate(&mut self, target: &Self, dt: f32);
|
fn interpolate(&mut self, target: &Self, dt: f32);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// rustc complains that `SkeletonAttr` fields are never read.
|
||||||
|
// Pls remove when they are.
|
||||||
|
#[allow(dead_code)]
|
||||||
pub struct SkeletonAttr {
|
pub struct SkeletonAttr {
|
||||||
scaler: f32,
|
scaler: f32,
|
||||||
head_scale: f32,
|
head_scale: f32,
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
use crate::audio::sfx::{SfxTriggerItem, SfxTriggers};
|
use crate::audio::sfx::{SfxTriggerItem, SfxTriggers};
|
||||||
|
|
||||||
use common::{
|
use common::{
|
||||||
comp::{Body, CharacterState, Item, ItemKind, PhysicsState, Pos, Stats, ToolData, Vel},
|
comp::{Body, CharacterState, PhysicsState, Pos, Stats, Vel},
|
||||||
event::{EventBus, SfxEvent, SfxEventItem},
|
event::{EventBus, SfxEvent, SfxEventItem},
|
||||||
state::State,
|
state::State,
|
||||||
};
|
};
|
||||||
@ -156,7 +156,7 @@ impl MovementEventMapper {
|
|||||||
physics_state: &PhysicsState,
|
physics_state: &PhysicsState,
|
||||||
previous_state: &PreviousEntityState,
|
previous_state: &PreviousEntityState,
|
||||||
vel: Vec3<f32>,
|
vel: Vec3<f32>,
|
||||||
stats: &Stats,
|
_stats: &Stats,
|
||||||
) -> SfxEvent {
|
) -> SfxEvent {
|
||||||
// Match run state
|
// Match run state
|
||||||
if physics_state.on_ground && vel.magnitude() > 0.1 {
|
if physics_state.on_ground && vel.magnitude() > 0.1 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user