Merge branch 'xMAC94x/update_toolchain' into 'master'

xmac94x/update toolchain

See merge request veloren/veloren!3709
This commit is contained in:
Marcel 2022-11-30 13:40:46 +00:00
commit 8a6e79c249
248 changed files with 603 additions and 675 deletions

View File

@ -13,7 +13,7 @@ variables:
# https://docs.gitlab.com/ee/ci/yaml/#shallow-cloning # https://docs.gitlab.com/ee/ci/yaml/#shallow-cloning
GIT_DEPTH: 3 GIT_DEPTH: 3
GIT_CLEAN_FLAGS: -f GIT_CLEAN_FLAGS: -f
CACHE_IMAGE_TAG: 9a0cb110 CACHE_IMAGE_TAG: 8e8fe241
TAG_REGEX: '/^v[0-9]+\.[0-9]+\.[0-9]+$/' TAG_REGEX: '/^v[0-9]+\.[0-9]+\.[0-9]+$/'
default: default:

View File

@ -521,7 +521,7 @@ impl Client {
Rgb::new(0.15, 0.15, 0.15) Rgb::new(0.15, 0.15, 0.15)
} else { } else {
// Color hill shading // Color hill shading
let lightness = (alt + 0.2).min(1.0) as f64; let lightness = (alt + 0.2).min(1.0);
Rgb::new(lightness, 0.9 * lightness, 0.5 * lightness) Rgb::new(lightness, 0.9 * lightness, 0.5 * lightness)
} }
} else if is_stylized_topo { } else if is_stylized_topo {
@ -995,8 +995,7 @@ impl Client {
let view_distances = common::ViewDistances { let view_distances = common::ViewDistances {
terrain: view_distances terrain: view_distances
.terrain .terrain
.max(1) .clamp(1, MAX_SELECTABLE_VIEW_DISTANCE),
.min(MAX_SELECTABLE_VIEW_DISTANCE),
entity: view_distances.entity.max(1), entity: view_distances.entity.max(1),
}; };
self.view_distance = Some(view_distances.terrain); self.view_distance = Some(view_distances.terrain);
@ -1004,6 +1003,7 @@ impl Client {
} }
pub fn set_lod_distance(&mut self, lod_distance: u32) { pub fn set_lod_distance(&mut self, lod_distance: u32) {
#[allow(clippy::manual_clamp)]
let lod_distance = lod_distance.max(0).min(1000) as f32 / lod::ZONE_SIZE as f32; let lod_distance = lod_distance.max(0).min(1000) as f32 / lod::ZONE_SIZE as f32;
self.lod_distance = lod_distance; self.lod_distance = lod_distance;
} }
@ -1789,7 +1789,8 @@ impl Client {
true, true,
); );
// TODO: avoid emitting these in the first place // TODO: avoid emitting these in the first place
self.state let _ = self
.state
.ecs() .ecs()
.fetch::<EventBus<common::event::ServerEvent>>() .fetch::<EventBus<common::event::ServerEvent>>()
.recv_all(); .recv_all();

View File

@ -300,7 +300,7 @@ where
{ {
fn default() -> Self { fn default() -> Self {
Self { Self {
own: Box::new(T::default()), own: Box::<T>::default(),
cpu_stats: CpuTimeline::default(), cpu_stats: CpuTimeline::default(),
} }
} }

View File

@ -111,8 +111,8 @@ pub struct EntitySyncPackage {
pub deleted_entities: Vec<u64>, pub deleted_entities: Vec<u64>,
} }
impl EntitySyncPackage { impl EntitySyncPackage {
pub fn new<'a>( pub fn new(
uids: &ReadStorage<'a, Uid>, uids: &ReadStorage<'_, Uid>,
uid_tracker: &UpdateTracker<Uid>, uid_tracker: &UpdateTracker<Uid>,
filter: impl Join + Copy, filter: impl Join + Copy,
deleted_entities: Vec<u64>, deleted_entities: Vec<u64>,
@ -186,10 +186,10 @@ impl<P: CompPacket> CompSyncPackage<P> {
/// If there was an update to the component `C` on the provided entity this /// If there was an update to the component `C` on the provided entity this
/// will add the update to this package. /// will add the update to this package.
pub fn add_component_update<'a, C: Component + Clone + Send + Sync>( pub fn add_component_update<C: Component + Clone + Send + Sync>(
&mut self, &mut self,
tracker: &UpdateTracker<C>, tracker: &UpdateTracker<C>,
storage: &ReadStorage<'a, C>, storage: &ReadStorage<'_, C>,
uid: u64, uid: u64,
entity: Entity, entity: Entity,
) where ) where

View File

@ -33,7 +33,7 @@ where
pub fn removed(&self) -> &BitSet { &self.removed } pub fn removed(&self) -> &BitSet { &self.removed }
pub fn record_changes<'a>(&mut self, storage: &ReadStorage<'a, C>) { pub fn record_changes(&mut self, storage: &ReadStorage<'_, C>) {
self.inserted.clear(); self.inserted.clear();
self.modified.clear(); self.modified.clear();
self.removed.clear(); self.removed.clear();
@ -66,9 +66,9 @@ where
} }
impl<C: Component + Clone + Send + Sync> UpdateTracker<C> { impl<C: Component + Clone + Send + Sync> UpdateTracker<C> {
pub fn add_packet_for<'a, P>( pub fn add_packet_for<P>(
&self, &self,
storage: &ReadStorage<'a, C>, storage: &ReadStorage<'_, C>,
entity: Entity, entity: Entity,
packets: &mut Vec<P>, packets: &mut Vec<P>,
) where ) where
@ -84,10 +84,10 @@ impl<C: Component + Clone + Send + Sync> UpdateTracker<C> {
} }
} }
pub fn get_updates_for<'a, P>( pub fn get_updates_for<P>(
&self, &self,
uids: &ReadStorage<'a, Uid>, uids: &ReadStorage<'_, Uid>,
storage: &ReadStorage<'a, C>, storage: &ReadStorage<'_, C>,
entity_filter: impl Join + Copy, entity_filter: impl Join + Copy,
buf: &mut Vec<(u64, CompUpdateKind<P>)>, buf: &mut Vec<(u64, CompUpdateKind<P>)>,
) where ) where
@ -125,9 +125,9 @@ impl<C: Component + Clone + Send + Sync> UpdateTracker<C> {
/// Returns `Some(update)` if the tracked component was modified for this /// Returns `Some(update)` if the tracked component was modified for this
/// entity. /// entity.
pub fn get_update<'a, P>( pub fn get_update<P>(
&self, &self,
storage: &ReadStorage<'a, C>, storage: &ReadStorage<'_, C>,
entity: Entity, entity: Entity,
) -> Option<CompUpdateKind<P>> ) -> Option<CompUpdateKind<P>>
where where

View File

@ -849,9 +849,7 @@ impl Damage {
let penetration = if let Some(damage) = damage { let penetration = if let Some(damage) = damage {
if let DamageKind::Piercing = damage.kind { if let DamageKind::Piercing = damage.kind {
(damage.value * PIERCING_PENETRATION_FRACTION) (damage.value * PIERCING_PENETRATION_FRACTION).clamp(0.0, protection.unwrap_or(0.0))
.min(protection.unwrap_or(0.0))
.max(0.0)
} else { } else {
0.0 0.0
} }
@ -1170,7 +1168,7 @@ pub fn combat_rating(
* compute_energy_reward_mod(Some(inventory), msm); * compute_energy_reward_mod(Some(inventory), msm);
// Normalized with a standard max poise of 100 // Normalized with a standard max poise of 100
let poise_rating = poise.base_max() as f32 let poise_rating = poise.base_max()
/ 100.0 / 100.0
/ (1.0 - Poise::compute_poise_damage_reduction(Some(inventory), msm, None, None)) / (1.0 - Poise::compute_poise_damage_reduction(Some(inventory), msm, None, None))
.max(0.00001); .max(0.00001);

View File

@ -2147,7 +2147,7 @@ impl From<(&CharacterAbility, AbilityInfo, &JoinData<'_>)> for CharacterState {
speed_increase: 1.0 - *speed_increase, speed_increase: 1.0 - *speed_increase,
max_speed_increase: *max_speed_increase, max_speed_increase: *max_speed_increase,
scales_from_combo: *scales_from_combo, scales_from_combo: *scales_from_combo,
ori_modifier: *ori_modifier as f32, ori_modifier: *ori_modifier,
ability_info, ability_info,
}, },
exhausted: false, exhausted: false,

View File

@ -207,7 +207,7 @@ impl Ori {
// NOTE: acos is very sensitive to errors at small angles // NOTE: acos is very sensitive to errors at small angles
// - https://www.researchgate.net/post/How_do_I_calculate_the_smallest_angle_between_two_quaternions // - https://www.researchgate.net/post/How_do_I_calculate_the_smallest_angle_between_two_quaternions
// - see angle_between unit test epislons // - see angle_between unit test epislons
let angle = 2.0 * between.w.min(1.0).max(-1.0).acos(); let angle = 2.0 * between.w.clamp(-1.0, 1.0).acos();
if angle < PI { angle } else { TAU - angle } if angle < PI { angle } else { TAU - angle }
} }
@ -317,7 +317,7 @@ fn rotation_2d(Vec2 { x, y }: Vec2<f32>, axis: Vec3<f32>) -> Quaternion<f32> {
// cos(a) = x / |xy| => x (when normalized) // cos(a) = x / |xy| => x (when normalized)
// Prevent NaNs from negative sqrt (float errors can put this slightly over 1.0) // Prevent NaNs from negative sqrt (float errors can put this slightly over 1.0)
let x = x.min(1.0).max(-1.0); let x = x.clamp(-1.0, 1.0);
let scalar = ((1.0 + x) / 2.0).sqrt() * y.signum(); let scalar = ((1.0 + x) / 2.0).sqrt() * y.signum();
let vector = axis * ((1.0 - x) / 2.0).sqrt(); let vector = axis * ((1.0 - x) / 2.0).sqrt();

View File

@ -11,7 +11,6 @@
trait_alias, trait_alias,
type_alias_impl_trait, type_alias_impl_trait,
extend_one, extend_one,
arbitrary_enum_discriminant,
arbitrary_self_types arbitrary_self_types
)] )]
#![feature(hash_drain_filter)] #![feature(hash_drain_filter)]

View File

@ -591,10 +591,10 @@ impl ComponentRecipe {
let mut slot_claims = HashMap::new(); let mut slot_claims = HashMap::new();
let mut unsatisfied_requirements = Vec::new(); let mut unsatisfied_requirements = Vec::new();
fn handle_requirement<'a, 'b, I: Iterator<Item = InvSlotId>>( fn handle_requirement<'a, I: Iterator<Item = InvSlotId>>(
slot_claims: &mut HashMap<InvSlotId, u32>, slot_claims: &mut HashMap<InvSlotId, u32>,
unsatisfied_requirements: &mut Vec<(&'a RecipeInput, u32)>, unsatisfied_requirements: &mut Vec<(&'a RecipeInput, u32)>,
inv: &'b Inventory, inv: &Inventory,
input: &'a RecipeInput, input: &'a RecipeInput,
amount: u32, amount: u32,
input_slots: I, input_slots: I,

View File

@ -110,9 +110,8 @@ impl SkillSetBuilder {
/// 2) If added skill already applied /// 2) If added skill already applied
/// 3) If added skill wasn't applied at the end /// 3) If added skill wasn't applied at the end
pub fn with_skill(mut self, skill: Skill, level: u16) -> Self { pub fn with_skill(mut self, skill: Skill, level: u16) -> Self {
let group = if let Some(skill_group) = skill.skill_group_kind() {
skill_group let Some(group) = skill.skill_group_kind() else {
} else {
let err = format!( let err = format!(
"Tried to add skill: {:?} which does not have an associated skill group.", "Tried to add skill: {:?} which does not have an associated skill group.",
skill skill
@ -131,7 +130,7 @@ impl SkillSetBuilder {
for _ in 0..level { for _ in 0..level {
skill_set.add_skill_points(group, skill_set.skill_cost(skill)); skill_set.add_skill_points(group, skill_set.skill_cost(skill));
if let Err(err) = skill_set.unlock_skill(skill) { if let Err(err) = skill_set.unlock_skill(skill) {
let err_msg = format!("Failed to add skill: {:?}. Error: {:?}", skill, err); let err_msg = format!("Failed to add skill: {skill:?}. Error: {err:?}");
common_base::dev_panic!(err_msg); common_base::dev_panic!(err_msg);
} }
} }

View File

@ -43,10 +43,10 @@ impl Iterator for Spiral2d {
let layer_size = (self.layer * 8 + 4 * self.layer.min(1) - 4).max(1); let layer_size = (self.layer * 8 + 4 * self.layer.min(1) - 4).max(1);
let pos = Vec2::new( let pos = Vec2::new(
-self.layer + (self.i - (layer_size / 4) * 0).max(0).min(self.layer * 2) -self.layer + (self.i - (layer_size / 4) * 0).clamp(0, self.layer * 2)
- (self.i - (layer_size / 4) * 2).max(0).min(self.layer * 2), - (self.i - (layer_size / 4) * 2).clamp(0, self.layer * 2),
-self.layer + (self.i - (layer_size / 4) * 1).max(0).min(self.layer * 2) -self.layer + (self.i - (layer_size / 4) * 1).clamp(0, self.layer * 2)
- (self.i - (layer_size / 4) * 3).max(0).min(self.layer * 2), - (self.i - (layer_size / 4) * 3).clamp(0, self.layer * 2),
); );
self.i += 1; self.i += 1;

View File

@ -89,7 +89,7 @@ impl CharacterBehavior for Data {
// Consumes energy if there's enough left and RMB is held down // Consumes energy if there's enough left and RMB is held down
update update
.energy .energy
.change_by(-self.static_data.energy_drain as f32 * data.dt.0 / 5.0); .change_by(-self.static_data.energy_drain * data.dt.0 / 5.0);
} else { } else {
// Transitions to swing // Transitions to swing
update.character = CharacterState::ChargedMelee(Data { update.character = CharacterState::ChargedMelee(Data {

View File

@ -99,8 +99,8 @@ impl CharacterBehavior for Data {
if !self.static_data.ability_info.input.map_or(false, |input| input_is_pressed(data, input)) && !self.exhausted { if !self.static_data.ability_info.input.map_or(false, |input| input_is_pressed(data, input)) && !self.exhausted {
let charge_frac = self.charge_frac(); let charge_frac = self.charge_frac();
let arrow = ProjectileConstructor::Arrow { let arrow = ProjectileConstructor::Arrow {
damage: self.static_data.initial_damage as f32 damage: self.static_data.initial_damage
+ charge_frac * self.static_data.scaled_damage as f32, + charge_frac * self.static_data.scaled_damage,
knockback: self.static_data.initial_knockback knockback: self.static_data.initial_knockback
+ charge_frac * self.static_data.scaled_knockback, + charge_frac * self.static_data.scaled_knockback,
energy_regen: self.static_data.initial_regen energy_regen: self.static_data.initial_regen

View File

@ -251,7 +251,7 @@ impl CharacterBehavior for Data {
Damage { Damage {
source: DamageSource::Melee, source: DamageSource::Melee,
kind: self.static_data.stage_data[stage_index].damage_kind, kind: self.static_data.stage_data[stage_index].damage_kind,
value: damage as f32, value: damage,
}, },
Some(GroupTarget::OutOfGroup), Some(GroupTarget::OutOfGroup),
rand::random(), rand::random(),

View File

@ -80,7 +80,7 @@ impl CharacterBehavior for Data {
// Attack // Attack
let poise = AttackEffect::new( let poise = AttackEffect::new(
Some(GroupTarget::OutOfGroup), Some(GroupTarget::OutOfGroup),
CombatEffect::Poise(self.static_data.poise_damage as f32), CombatEffect::Poise(self.static_data.poise_damage),
) )
.with_requirement(CombatRequirement::AnyDamage); .with_requirement(CombatRequirement::AnyDamage);
let knockback = AttackEffect::new( let knockback = AttackEffect::new(
@ -92,7 +92,7 @@ impl CharacterBehavior for Data {
Damage { Damage {
source: DamageSource::Shockwave, source: DamageSource::Shockwave,
kind: self.static_data.damage_kind, kind: self.static_data.damage_kind,
value: self.static_data.damage as f32, value: self.static_data.damage,
}, },
Some(GroupTarget::OutOfGroup), Some(GroupTarget::OutOfGroup),
rand::random(), rand::random(),

View File

@ -58,8 +58,7 @@ impl CharacterBehavior for Data {
} }
// forward, max at 8u/s // forward, max at 8u/s
(data.dt.0 * 3.0) (data.dt.0 * 3.0)
.min(8.0 - current_planar_velocity) .clamp(0.0, 8.0 - current_planar_velocity)
.max(0.0)
} else { } else {
if let CharacterState::Skate(data) = &mut update.character { if let CharacterState::Skate(data) = &mut update.character {
data.accelerate = -1.0; data.accelerate = -1.0;

View File

@ -118,7 +118,7 @@ impl CharacterBehavior for Data {
timer: tick_attack_or_default(data, self.timer, None), timer: tick_attack_or_default(data, self.timer, None),
..*self ..*self
}); });
} else if update.energy.current() as f32 >= self.static_data.energy_cost } else if update.energy.current() >= self.static_data.energy_cost
&& (self.consecutive_spins < self.static_data.num_spins && (self.consecutive_spins < self.static_data.num_spins
|| (self.static_data.is_infinite || (self.static_data.is_infinite
&& self.static_data.ability_info.input.map_or(false, |input| input_is_pressed(data, input)))) && self.static_data.ability_info.input.map_or(false, |input| input_is_pressed(data, input))))

View File

@ -116,7 +116,7 @@ impl CharacterBehavior for Data {
// Location sprite will be created // Location sprite will be created
let sprite_pos = let sprite_pos =
Vec3::new(sprite_pos.x as i32, sprite_pos.y as i32, z); Vec3::new(sprite_pos.x, sprite_pos.y, z);
// Layers of sprites // Layers of sprites
let layers = match self.static_data.sprite { let layers = match self.static_data.sprite {
SpriteKind::SeaUrchin => 2, SpriteKind::SeaUrchin => 2,
@ -125,7 +125,7 @@ impl CharacterBehavior for Data {
for i in 0..layers { for i in 0..layers {
// Send server event to create sprite // Send server event to create sprite
output_events.emit_server(ServerEvent::CreateSprite { output_events.emit_server(ServerEvent::CreateSprite {
pos: Vec3::new(sprite_pos.x as i32, sprite_pos.y, z + i), pos: Vec3::new(sprite_pos.x, sprite_pos.y, z + i),
sprite: self.static_data.sprite, sprite: self.static_data.sprite,
}); });
} }

View File

@ -622,7 +622,7 @@ pub fn fly_move(data: &JoinData<'_>, update: &mut StateUpdate, efficiency: f32)
let change = if data.inputs.move_z.abs() > f32::EPSILON { let change = if data.inputs.move_z.abs() > f32::EPSILON {
-data.inputs.move_z -data.inputs.move_z
} else { } else {
(def - data.density.0).max(-1.0).min(1.0) (def - data.density.0).clamp(-1.0, 1.0)
}; };
Density((update.density.0 + data.dt.0 * rate * change).clamp(min, max)) Density((update.density.0 + data.dt.0 * rate * change).clamp(min, max))
}; };

View File

@ -27,8 +27,7 @@ impl CharacterBehavior for Data {
update.vel.0.z += data.dt.0 update.vel.0.z += data.dt.0
* lift * lift
* (Vec2::<f32>::from(update.vel.0).magnitude() * 0.075) * (Vec2::<f32>::from(update.vel.0).magnitude() * 0.075)
.min(1.0) .clamp(0.2, 1.0);
.max(0.2);
} }
// fall off wall, hit ground, or enter water // fall off wall, hit ground, or enter water

View File

@ -494,8 +494,8 @@ impl<'a> MapConfig<'a> {
let world_size = map_size_lg.chunks(); let world_size = map_size_lg.chunks();
(0..dimensions.y * dimensions.x).for_each(|chunk_idx| { (0..dimensions.y * dimensions.x).for_each(|chunk_idx| {
let i = chunk_idx % dimensions.x as usize; let i = chunk_idx % dimensions.x;
let j = chunk_idx / dimensions.x as usize; let j = chunk_idx / dimensions.x;
let wposf = focus_rect + Vec2::new(i as f64, j as f64) * scale; let wposf = focus_rect + Vec2::new(i as f64, j as f64) * scale;
let pos = wposf.map(|e: f64| e as i32); let pos = wposf.map(|e: f64| e as i32);
@ -678,7 +678,7 @@ impl<'a> MapConfig<'a> {
let deltax = height / angle; let deltax = height / angle;
let lighty = (light_direction.y / light_direction.x * deltax).abs(); let lighty = (light_direction.y / light_direction.x * deltax).abs();
let deltay = lighty - height; let deltay = lighty - height;
let s = (deltay / deltax / w).min(1.0).max(0.0); let s = (deltay / deltax / w).clamp(0.0, 1.0);
// Smoothstep // Smoothstep
s * s * (3.0 - 2.0 * s) s * s * (3.0 - 2.0 * s)
} else { } else {

View File

@ -135,7 +135,7 @@ pub fn xyy_to_rgb(xyy: Vec3<f32>) -> Rgb<f32> {
pub fn saturate_srgb(col: Rgb<f32>, value: f32) -> Rgb<f32> { pub fn saturate_srgb(col: Rgb<f32>, value: f32) -> Rgb<f32> {
let mut hsv = rgb_to_hsv(srgb_to_linear(col)); let mut hsv = rgb_to_hsv(srgb_to_linear(col));
hsv.y *= 1.0 + value; hsv.y *= 1.0 + value;
linear_to_srgb(hsv_to_rgb(hsv).map(|e| e.min(1.0).max(0.0))) linear_to_srgb(hsv_to_rgb(hsv).map(|e| e.clamp(0.0, 1.0)))
} }
/// Preserves the luma of one color while changing its chromaticity to match the /// Preserves the luma of one color while changing its chromaticity to match the
@ -146,5 +146,5 @@ pub fn chromify_srgb(luma: Rgb<f32>, chroma: Rgb<f32>) -> Rgb<f32> {
let mut xyy = rgb_to_xyy(srgb_to_linear(chroma)); let mut xyy = rgb_to_xyy(srgb_to_linear(chroma));
xyy.z = l; xyy.z = l;
linear_to_srgb(xyy_to_rgb(xyy).map(|e| e.min(1.0).max(0.0))) linear_to_srgb(xyy_to_rgb(xyy).map(|e| e.clamp(0.0, 1.0)))
} }

View File

@ -16,10 +16,10 @@ impl ViewDistances {
/// ///
/// Also ensures both are at a minimum of 1 (unless the provided max is 0). /// Also ensures both are at a minimum of 1 (unless the provided max is 0).
pub fn clamp(self, max: Option<u32>) -> Self { pub fn clamp(self, max: Option<u32>) -> Self {
let terrain = self.terrain.max(1).min(max.unwrap_or(u32::MAX)); let terrain = self.terrain.clamp(1,max.unwrap_or(u32::MAX));
Self { Self {
terrain, terrain,
entity: self.entity.max(1).min(terrain), entity: self.entity.clamp(1,terrain),
} }
} }
} }

View File

@ -71,7 +71,7 @@ impl<V, S: VolSize, M> Chunk<V, S, M> {
Self::GROUP_VOLUME / (Self::GROUP_LONG_SIDE_LEN * Self::GROUP_LONG_SIDE_LEN), Self::GROUP_VOLUME / (Self::GROUP_LONG_SIDE_LEN * Self::GROUP_LONG_SIDE_LEN),
); );
const GROUP_VOLUME: u32 = [Self::VOLUME / 256, 1][(Self::VOLUME < 256) as usize]; const GROUP_VOLUME: u32 = [Self::VOLUME / 256, 1][(Self::VOLUME < 256) as usize];
const VOLUME: u32 = (S::SIZE.x * S::SIZE.y * S::SIZE.z) as u32; const VOLUME: u32 = (S::SIZE.x * S::SIZE.y * S::SIZE.z);
/// Creates a new `Chunk` with the provided dimensions and all voxels filled /// Creates a new `Chunk` with the provided dimensions and all voxels filled
/// with duplicates of the provided voxel. /// with duplicates of the provided voxel.

View File

@ -370,7 +370,7 @@ fn execute_effect(
{ {
let amount = match *kind { let amount = match *kind {
ModifierKind::Additive => *accumulated, ModifierKind::Additive => *accumulated,
ModifierKind::Fractional => energy.maximum() as f32 * *accumulated, ModifierKind::Fractional => energy.maximum() * *accumulated,
}; };
server_emitter.emit(ServerEvent::EnergyChange { server_emitter.emit(ServerEvent::EnergyChange {
entity, entity,
@ -395,6 +395,7 @@ fn execute_effect(
stat.max_energy_modifiers.mult_mod *= *value; stat.max_energy_modifiers.mult_mod *= *value;
}, },
}, },
#[allow(clippy::manual_clamp)]
BuffEffect::DamageReduction(dr) => { BuffEffect::DamageReduction(dr) => {
stat.damage_reduction = stat.damage_reduction.max(*dr).min(1.0); stat.damage_reduction = stat.damage_reduction.max(*dr).min(1.0);
}, },
@ -421,7 +422,7 @@ fn execute_effect(
ModifierKind::Additive => { ModifierKind::Additive => {
// `rate * dt` is amount of health, dividing by base max // `rate * dt` is amount of health, dividing by base max
// creates fraction // creates fraction
*rate * dt / health.base_max() as f32 *rate * dt / health.base_max()
}, },
ModifierKind::Fractional => { ModifierKind::Fractional => {
// `rate * dt` is the fraction // `rate * dt` is the fraction
@ -466,6 +467,7 @@ fn execute_effect(
BuffEffect::GroundFriction(gf) => { BuffEffect::GroundFriction(gf) => {
stat.friction_modifier *= *gf; stat.friction_modifier *= *gf;
}, },
#[allow(clippy::manual_clamp)]
BuffEffect::PoiseReduction(pr) => { BuffEffect::PoiseReduction(pr) => {
stat.poise_reduction = stat.poise_reduction.max(*pr).min(1.0); stat.poise_reduction = stat.poise_reduction.max(*pr).min(1.0);
}, },

View File

@ -1333,9 +1333,9 @@ impl<'a> System<'a> for Sys {
} }
#[allow(clippy::too_many_lines)] #[allow(clippy::too_many_lines)]
fn box_voxel_collision<'a, T: BaseVol<Vox = Block> + ReadVol>( fn box_voxel_collision<T: BaseVol<Vox = Block> + ReadVol>(
cylinder: (f32, f32, f32), // effective collision cylinder cylinder: (f32, f32, f32), // effective collision cylinder
terrain: &'a T, terrain: &T,
entity: Entity, entity: Entity,
pos: &mut Pos, pos: &mut Pos,
tgt_pos: Vec3<f32>, tgt_pos: Vec3<f32>,
@ -1738,7 +1738,7 @@ fn box_voxel_collision<'a, T: BaseVol<Vox = Block> + ReadVol>(
// E=½mv², we scale both energies by ½m // E=½mv², we scale both energies by ½m
let kinetic = squared_velocity; let kinetic = squared_velocity;
// positive accelerate, negative decelerate, ΔE=mgΔh // positive accelerate, negative decelerate, ΔE=mgΔh
let delta_potential = vertical_difference.max(-1.0).min(2.0) * POTENTIAL_TO_KINETIC; let delta_potential = vertical_difference.clamp(-1.0, 2.0) * POTENTIAL_TO_KINETIC;
let new_energy = kinetic + delta_potential; let new_energy = kinetic + delta_potential;
physics_state.skating_last_height = pos.0.z; physics_state.skating_last_height = pos.0.z;
new_energy / kinetic new_energy / kinetic

View File

@ -131,14 +131,14 @@ impl NetworkMetrics {
let opts = Opts::new("network_info", "Static Network information") let opts = Opts::new("network_info", "Static Network information")
.const_label( .const_label(
"version", "version",
&format!( format!(
"{}.{}.{}", "{}.{}.{}",
&network_protocol::VELOREN_NETWORK_VERSION[0], &network_protocol::VELOREN_NETWORK_VERSION[0],
&network_protocol::VELOREN_NETWORK_VERSION[1], &network_protocol::VELOREN_NETWORK_VERSION[1],
&network_protocol::VELOREN_NETWORK_VERSION[2] &network_protocol::VELOREN_NETWORK_VERSION[2]
), ),
) )
.const_label("local_pid", &format!("{}", &local_pid)); .const_label("local_pid", format!("{}", &local_pid));
let network_info = IntGauge::with_opts(opts)?; let network_info = IntGauge::with_opts(opts)?;
Ok(Self { Ok(Self {

View File

@ -1 +1 @@
nightly-2022-09-23 nightly-2022-11-28

View File

@ -2520,7 +2520,7 @@ impl<'a> AgentData<'a> {
) { ) {
controller.inputs.look_dir = Dir::new( controller.inputs.look_dir = Dir::new(
Quaternion::from_xyzw(self.ori.look_dir().x, self.ori.look_dir().y, 0.0, 0.0) Quaternion::from_xyzw(self.ori.look_dir().x, self.ori.look_dir().y, 0.0, 0.0)
.rotated_z(6.0 * read_data.dt.0 as f32) .rotated_z(6.0 * read_data.dt.0)
.into_vec3() .into_vec3()
.try_normalized() .try_normalized()
.unwrap_or_default(), .unwrap_or_default(),

View File

@ -2103,9 +2103,9 @@ fn handle_light(
return Err("cr, cg and cb values mustn't be negative.".into()); return Err("cr, cg and cb values mustn't be negative.".into());
} }
let r = r.max(0.0).min(1.0); let r = r.clamp(0.0, 1.0);
let g = g.max(0.0).min(1.0); let g = g.clamp(0.0, 1.0);
let b = b.max(0.0).min(1.0); let b = b.clamp(0.0, 1.0);
light_emitter.col = Rgb::new(r, g, b) light_emitter.col = Rgb::new(r, g, b)
}; };
if let (Some(x), Some(y), Some(z)) = (opt_x, opt_y, opt_z) { if let (Some(x), Some(y), Some(z)) = (opt_x, opt_y, opt_z) {
@ -2152,14 +2152,9 @@ fn handle_lantern(
.write_storage::<LightEmitter>() .write_storage::<LightEmitter>()
.get_mut(target) .get_mut(target)
{ {
light.strength = s.max(0.1).min(10.0); light.strength = s.clamp(0.1, 10.0);
if let (Some(r), Some(g), Some(b)) = (r, g, b) { if let (Some(r), Some(g), Some(b)) = (r, g, b) {
light.col = ( light.col = (r.clamp(0.0, 1.0), g.clamp(0.0, 1.0), b.clamp(0.0, 1.0)).into();
r.max(0.0).min(1.0),
g.max(0.0).min(1.0),
b.max(0.0).min(1.0),
)
.into();
server.notify_client( server.notify_client(
client, client,
ServerGeneral::server_msg( ServerGeneral::server_msg(

View File

@ -211,7 +211,7 @@ pub(crate) fn establish_connection(
ConnectionMode::ReadOnly => OpenFlags::SQLITE_OPEN_READ_ONLY, ConnectionMode::ReadOnly => OpenFlags::SQLITE_OPEN_READ_ONLY,
}; };
let connection = Connection::open_with_flags(&settings.db_dir.join("db.sqlite"), open_flags) let connection = Connection::open_with_flags(settings.db_dir.join("db.sqlite"), open_flags)
.unwrap_or_else(|err| { .unwrap_or_else(|err| {
panic!( panic!(
"Error connecting to {}, Error: {:?}", "Error connecting to {}, Error: {:?}",

View File

@ -80,7 +80,7 @@ impl ViewDistance {
pub fn new(start_value: u32, now: Instant) -> Self { pub fn new(start_value: u32, now: Instant) -> Self {
Self { Self {
direction: Direction::Up, direction: Direction::Up,
last_direction_change_time: now - Self::TIME_PER_DIR_CHANGE, last_direction_change_time: now.checked_sub(Self::TIME_PER_DIR_CHANGE).unwrap_or(now),
target: None, target: None,
current: start_value, current: start_value,
} }

View File

@ -228,7 +228,7 @@ pub fn init(
} }
// guards // guards
for _ in 0..site2.plazas().len() as usize { for _ in 0..site2.plazas().len() {
rtsim.entities.insert(Entity { rtsim.entities.insert(Entity {
is_loaded: false, is_loaded: false,
pos: site2 pos: site2
@ -252,7 +252,7 @@ pub fn init(
} }
// merchants // merchants
for _ in 0..site2.plazas().len() as usize { for _ in 0..site2.plazas().len() {
rtsim.entities.insert(Entity { rtsim.entities.insert(Entity {
is_loaded: false, is_loaded: false,
pos: site2 pos: site2
@ -350,7 +350,7 @@ pub fn init(
} }
// guards // guards
for _ in 0..site2.plazas().len() as usize { for _ in 0..site2.plazas().len() {
rtsim.entities.insert(Entity { rtsim.entities.insert(Entity {
is_loaded: false, is_loaded: false,
pos: site2 pos: site2
@ -374,7 +374,7 @@ pub fn init(
} }
// merchants // merchants
for _ in 0..site2.plazas().len() as usize { for _ in 0..site2.plazas().len() {
rtsim.entities.insert(Entity { rtsim.entities.insert(Entity {
is_loaded: false, is_loaded: false,
pos: site2 pos: site2

View File

@ -3,7 +3,7 @@ use core::{convert::TryInto, fmt};
use serde::{de::DeserializeOwned, Serialize}; use serde::{de::DeserializeOwned, Serialize};
use std::{ use std::{
fs, fs,
io::{Seek, SeekFrom, Write}, io::{Seek, Write},
path::{Path, PathBuf}, path::{Path, PathBuf},
}; };
use tracing::{error, info, warn}; use tracing::{error, info, warn};
@ -80,7 +80,7 @@ pub trait EditableSetting: Clone + Default {
match ron::de::from_reader(&mut file) match ron::de::from_reader(&mut file)
.map(|setting: Self::Setting| setting.try_into()) .map(|setting: Self::Setting| setting.try_into())
.or_else(|orig_err| { .or_else(|orig_err| {
file.seek(SeekFrom::Start(0))?; file.rewind()?;
ron::de::from_reader(file) ron::de::from_reader(file)
.map(|legacy| Ok((Version::Old, Self::Legacy::into(legacy)))) .map(|legacy| Ok((Version::Old, Self::Legacy::into(legacy))))
// When both legacy and non-legacy have parse errors, prioritize the // When both legacy and non-legacy have parse errors, prioritize the

View File

@ -222,7 +222,7 @@ pub fn initialize_region_subscription(world: &World, entity: specs::Entity) {
let chunk_size = TerrainChunkSize::RECT_SIZE.reduce_max() as f32; let chunk_size = TerrainChunkSize::RECT_SIZE.reduce_max() as f32;
let regions = regions_in_vd( let regions = regions_in_vd(
client_pos.0, client_pos.0,
(presence.entity_view_distance.current() as f32 * chunk_size) as f32 (presence.entity_view_distance.current() as f32 * chunk_size)
+ (presence::CHUNK_FUZZ as f32 + chunk_size) * 2.0f32.sqrt(), + (presence::CHUNK_FUZZ as f32 + chunk_size) * 2.0f32.sqrt(),
); );

View File

@ -566,8 +566,7 @@ pub fn convert_to_loaded_vd(vd: u32, max_view_distance: u32) -> i32 {
const UNLOAD_THRESHOLD: u32 = 2; const UNLOAD_THRESHOLD: u32 = 2;
// NOTE: This cast is safe for the reasons mentioned above. // NOTE: This cast is safe for the reasons mentioned above.
(vd.max(crate::MIN_VD) (vd.clamp(crate::MIN_VD, max_view_distance)
.min(max_view_distance)
.saturating_add(UNLOAD_THRESHOLD)) .saturating_add(UNLOAD_THRESHOLD))
.min(MAX_VD) as i32 .min(MAX_VD) as i32
} }
@ -617,7 +616,7 @@ fn prepare_for_vd_check(
// world chunk coordinates are no greater than 1 << 14 - 1; since we verified that the // world chunk coordinates are no greater than 1 << 14 - 1; since we verified that the
// player is within world bounds modulo player_vd, which is guaranteed to never let us // player is within world bounds modulo player_vd, which is guaranteed to never let us
// overflow an i16 when added to a u14, safety of the cast follows. // overflow an i16 when added to a u14, safety of the cast follows.
.then(|| ((player_chunk_pos.as_::<i16>(), player_vd.pow(2) as i32), entity, is_client)) .then(|| ((player_chunk_pos.as_::<i16>(), player_vd.pow(2)), entity, is_client))
} }
pub fn prepare_player_presences<'a, P>( pub fn prepare_player_presences<'a, P>(

View File

@ -115,23 +115,21 @@ impl WeatherSim {
} else { } else {
let wpos = cell_to_wpos_center(point); let wpos = cell_to_wpos_center(point);
let pos = wpos.as_::<f64>() + time as f64 * 0.1; let pos = wpos.as_::<f64>() + time * 0.1;
let space_scale = 7_500.0; let space_scale = 7_500.0;
let time_scale = 100_000.0; let time_scale = 100_000.0;
let spos = (pos / space_scale).with_z(time as f64 / time_scale); let spos = (pos / space_scale).with_z(time / time_scale);
let avg_scale = 20_000.0; let avg_scale = 20_000.0;
let avg_delay = 250_000.0; let avg_delay = 250_000.0;
let pressure = ((base_nz.get( let pressure = ((base_nz
(pos / avg_scale) .get((pos / avg_scale).with_z(time / avg_delay).into_array())
.with_z(time as f64 / avg_delay) + base_nz.get(
.into_array(), (pos / (avg_scale * 0.25))
) + base_nz.get( .with_z(time / (avg_delay * 0.25))
(pos / (avg_scale * 0.25)) .into_array(),
.with_z(time as f64 / (avg_delay * 0.25)) ) * 0.5)
.into_array(),
) * 0.5)
* 0.5 * 0.5
+ 1.0) + 1.0)
.clamped(0.0, 1.0) as f32 .clamped(0.0, 1.0) as f32

View File

@ -16,9 +16,9 @@ impl Animation for AlphaAnimation {
const UPDATE_FN: &'static [u8] = b"arthropod_alpha\0"; const UPDATE_FN: &'static [u8] = b"arthropod_alpha\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "arthropod_alpha")] #[cfg_attr(feature = "be-dyn-lib", export_name = "arthropod_alpha")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(_velocity, global_time, stage_section, timer): Self::Dependency<'a>, (_velocity, global_time, stage_section, timer): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -14,9 +14,9 @@ impl Animation for DashAnimation {
const UPDATE_FN: &'static [u8] = b"arthropod_dash\0"; const UPDATE_FN: &'static [u8] = b"arthropod_dash\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "arthropod_dash")] #[cfg_attr(feature = "be-dyn-lib", export_name = "arthropod_dash")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(_velocity, _global_time, stage_section, _timer): Self::Dependency<'a>, (_velocity, _global_time, stage_section, _timer): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -13,9 +13,9 @@ impl Animation for IdleAnimation {
const UPDATE_FN: &'static [u8] = b"arthropod_idle\0"; const UPDATE_FN: &'static [u8] = b"arthropod_idle\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "arthropod_idle")] #[cfg_attr(feature = "be-dyn-lib", export_name = "arthropod_idle")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
_global_time: Self::Dependency<'a>, _global_time: Self::Dependency<'_>,
_anim_time: f32, _anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -13,9 +13,9 @@ impl Animation for JumpAnimation {
const UPDATE_FN: &'static [u8] = b"arthropod_jump\0"; const UPDATE_FN: &'static [u8] = b"arthropod_jump\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "arthropod_jump")] #[cfg_attr(feature = "be-dyn-lib", export_name = "arthropod_jump")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(_velocity, _orientation, _last_ori, _global_time, _avg_vel): Self::Dependency<'a>, (_velocity, _orientation, _last_ori, _global_time, _avg_vel): Self::Dependency<'_>,
_anim_time: f32, _anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -16,9 +16,9 @@ impl Animation for LeapMeleeAnimation {
const UPDATE_FN: &'static [u8] = b"arthropod_leapmelee\0"; const UPDATE_FN: &'static [u8] = b"arthropod_leapmelee\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "arthropod_leapmelee")] #[cfg_attr(feature = "be-dyn-lib", export_name = "arthropod_leapmelee")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(_velocity, global_time, stage_section, _timer): Self::Dependency<'a>, (_velocity, global_time, stage_section, _timer): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -14,9 +14,9 @@ impl Animation for RunAnimation {
const UPDATE_FN: &'static [u8] = b"arthropod_run\0"; const UPDATE_FN: &'static [u8] = b"arthropod_run\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "arthropod_run")] #[cfg_attr(feature = "be-dyn-lib", export_name = "arthropod_run")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(velocity, _orientation, _last_ori, _global_time, avg_vel, acc_vel): Self::Dependency<'a>, (velocity, _orientation, _last_ori, _global_time, avg_vel, acc_vel): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
rate: &mut f32, rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -14,9 +14,9 @@ impl Animation for ShootAnimation {
const UPDATE_FN: &'static [u8] = b"arthropod_shoot\0"; const UPDATE_FN: &'static [u8] = b"arthropod_shoot\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "arthropod_shoot")] #[cfg_attr(feature = "be-dyn-lib", export_name = "arthropod_shoot")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(_velocity, _global_time, stage_section, _timer): Self::Dependency<'a>, (_velocity, _global_time, stage_section, _timer): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -14,9 +14,9 @@ impl Animation for StunnedAnimation {
const UPDATE_FN: &'static [u8] = b"arthropod_stunned\0"; const UPDATE_FN: &'static [u8] = b"arthropod_stunned\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "arthropod_stunned")] #[cfg_attr(feature = "be-dyn-lib", export_name = "arthropod_stunned")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(_velocity, global_time, stage_section, timer): Self::Dependency<'a>, (_velocity, global_time, stage_section, timer): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -16,9 +16,9 @@ impl Animation for SummonAnimation {
const UPDATE_FN: &'static [u8] = b"arthropod_summon\0"; const UPDATE_FN: &'static [u8] = b"arthropod_summon\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "arthropod_summon")] #[cfg_attr(feature = "be-dyn-lib", export_name = "arthropod_summon")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(_velocity, global_time, stage_section, timer): Self::Dependency<'a>, (_velocity, global_time, stage_section, timer): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -26,7 +26,7 @@ impl Animation for AlphaAnimation {
const UPDATE_FN: &'static [u8] = b"biped_large_alpha\0"; const UPDATE_FN: &'static [u8] = b"biped_large_alpha\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_alpha")] #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_alpha")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
( (
(active_tool_kind, active_tool_spec), (active_tool_kind, active_tool_spec),
@ -36,7 +36,7 @@ impl Animation for AlphaAnimation {
stage_section, stage_section,
acc_vel, acc_vel,
timer, timer,
): Self::Dependency<'a>, ): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
rate: &mut f32, rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -26,7 +26,7 @@ impl Animation for BeamAnimation {
const UPDATE_FN: &'static [u8] = b"biped_large_beam\0"; const UPDATE_FN: &'static [u8] = b"biped_large_beam\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_beam")] #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_beam")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
( (
(active_tool_kind, active_tool_spec), (active_tool_kind, active_tool_spec),
@ -36,7 +36,7 @@ impl Animation for BeamAnimation {
stage_section, stage_section,
acc_vel, acc_vel,
timer, timer,
): Self::Dependency<'a>, ): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
rate: &mut f32, rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -25,7 +25,7 @@ impl Animation for BetaAnimation {
const UPDATE_FN: &'static [u8] = b"biped_large_beta\0"; const UPDATE_FN: &'static [u8] = b"biped_large_beta\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_beta")] #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_beta")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
( (
(active_tool_kind, active_tool_spec), (active_tool_kind, active_tool_spec),
@ -34,7 +34,7 @@ impl Animation for BetaAnimation {
_global_time, _global_time,
stage_section, stage_section,
acc_vel, acc_vel,
): Self::Dependency<'a>, ): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
rate: &mut f32, rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -22,9 +22,9 @@ impl Animation for BlinkAnimation {
const UPDATE_FN: &'static [u8] = b"biped_large_blink\0"; const UPDATE_FN: &'static [u8] = b"biped_large_blink\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_blink")] #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_blink")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(active_tool_kind, _second_tool_kind, velocity, _global_time, stage_section, acc_vel): Self::Dependency<'a>, (active_tool_kind, _second_tool_kind, velocity, _global_time, stage_section, acc_vel): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
rate: &mut f32, rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -22,9 +22,9 @@ impl Animation for ChargeAnimation {
const UPDATE_FN: &'static [u8] = b"biped_large_charge\0"; const UPDATE_FN: &'static [u8] = b"biped_large_charge\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_charge")] #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_charge")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(active_tool_kind, _second_tool_kind, velocity, orientation, last_ori, _global_time): Self::Dependency<'a>, (active_tool_kind, _second_tool_kind, velocity, orientation, last_ori, _global_time): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -25,7 +25,7 @@ impl Animation for ChargeMeleeAnimation {
const UPDATE_FN: &'static [u8] = b"biped_large_chargemelee\0"; const UPDATE_FN: &'static [u8] = b"biped_large_chargemelee\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_chargemelee")] #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_chargemelee")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
( (
(active_tool_kind, active_tool_spec), (active_tool_kind, active_tool_spec),
@ -34,7 +34,7 @@ impl Animation for ChargeMeleeAnimation {
_global_time, _global_time,
stage_section, stage_section,
acc_vel, acc_vel,
): Self::Dependency<'a>, ): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
rate: &mut f32, rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -25,7 +25,7 @@ impl Animation for DashAnimation {
const UPDATE_FN: &'static [u8] = b"biped_large_dash\0"; const UPDATE_FN: &'static [u8] = b"biped_large_dash\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_dash")] #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_dash")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
( (
(active_tool_kind, active_tool_spec), (active_tool_kind, active_tool_spec),
@ -34,7 +34,7 @@ impl Animation for DashAnimation {
_global_time, _global_time,
stage_section, stage_section,
acc_vel, acc_vel,
): Self::Dependency<'a>, ): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
rate: &mut f32, rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -15,9 +15,9 @@ impl Animation for EquipAnimation {
const UPDATE_FN: &'static [u8] = b"biped_large_equip\0"; const UPDATE_FN: &'static [u8] = b"biped_large_equip\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_equip")] #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_equip")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(active_tool_kind, _second_tool_kind, _velocity, _global_time): Self::Dependency<'a>, (active_tool_kind, _second_tool_kind, _velocity, _global_time): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
rate: &mut f32, rate: &mut f32,
_s_a: &SkeletonAttr, _s_a: &SkeletonAttr,

View File

@ -15,9 +15,9 @@ impl Animation for IdleAnimation {
const UPDATE_FN: &'static [u8] = b"biped_large_idle\0"; const UPDATE_FN: &'static [u8] = b"biped_large_idle\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_idle")] #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_idle")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(active_tool_kind, _second_tool_kind, global_time): Self::Dependency<'a>, (active_tool_kind, _second_tool_kind, global_time): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -15,9 +15,9 @@ impl Animation for JumpAnimation {
const UPDATE_FN: &'static [u8] = b"biped_large_jump\0"; const UPDATE_FN: &'static [u8] = b"biped_large_jump\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_jump")] #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_jump")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(active_tool_kind, _second_tool_kind, _global_time): Self::Dependency<'a>, (active_tool_kind, _second_tool_kind, _global_time): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -21,9 +21,9 @@ impl Animation for LeapAnimation {
const UPDATE_FN: &'static [u8] = b"biped_large_leapmelee\0"; const UPDATE_FN: &'static [u8] = b"biped_large_leapmelee\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_leapmelee")] #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_leapmelee")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(active_tool_kind, _second_tool_kind, _velocity, _global_time, stage_section): Self::Dependency<'a>, (active_tool_kind, _second_tool_kind, _velocity, _global_time, stage_section): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
rate: &mut f32, rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -25,7 +25,7 @@ impl Animation for RunAnimation {
const UPDATE_FN: &'static [u8] = b"biped_large_run\0"; const UPDATE_FN: &'static [u8] = b"biped_large_run\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_run")] #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_run")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
( (
active_tool_kind, active_tool_kind,
@ -36,7 +36,7 @@ impl Animation for RunAnimation {
global_time, global_time,
avg_vel, avg_vel,
acc_vel, acc_vel,
): Self::Dependency<'a>, ): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
rate: &mut f32, rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,
@ -127,8 +127,7 @@ impl Animation for RunAnimation {
let side = ((velocity.x * -0.098 * orientation.y + velocity.y * 0.098 * orientation.x) let side = ((velocity.x * -0.098 * orientation.y + velocity.y * 0.098 * orientation.x)
* -1.0) * -1.0)
.min(1.0) .clamp(-1.0, 1.0);
.max(-1.0);
let sideabs = side.abs(); let sideabs = side.abs();
let x_tilt = avg_vel.z.atan2(avg_vel.xy().magnitude()); let x_tilt = avg_vel.z.atan2(avg_vel.xy().magnitude());

View File

@ -25,7 +25,7 @@ impl Animation for SelfBuffAnimation {
const UPDATE_FN: &'static [u8] = b"biped_large_selfbuff\0"; const UPDATE_FN: &'static [u8] = b"biped_large_selfbuff\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_selfbuff")] #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_selfbuff")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
( (
(active_tool_kind, active_tool_spec), (active_tool_kind, active_tool_spec),
@ -34,7 +34,7 @@ impl Animation for SelfBuffAnimation {
_global_time, _global_time,
stage_section, stage_section,
acc_vel, acc_vel,
): Self::Dependency<'a>, ): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
rate: &mut f32, rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -26,7 +26,7 @@ impl Animation for ShockwaveAnimation {
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_shockwave")] #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_shockwave")]
#[allow(clippy::single_match)] // TODO: Pending review in #587 #[allow(clippy::single_match)] // TODO: Pending review in #587
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
( (
(active_tool_kind, active_tool_spec), (active_tool_kind, active_tool_spec),
@ -34,7 +34,7 @@ impl Animation for ShockwaveAnimation {
_global_time, _global_time,
velocity, velocity,
stage_section, stage_section,
): Self::Dependency<'a>, ): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
rate: &mut f32, rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,
@ -43,7 +43,7 @@ impl Animation for ShockwaveAnimation {
let mut next = (*skeleton).clone(); let mut next = (*skeleton).clone();
let (move1, move1pow, move2, move3) = match stage_section { let (move1, move1pow, move2, move3) = match stage_section {
Some(StageSection::Buildup) => (anim_time, anim_time.powf(0.25) as f32, 0.0, 0.0), Some(StageSection::Buildup) => (anim_time, anim_time.powf(0.25), 0.0, 0.0),
Some(StageSection::Action) => (1.0, 1.0, anim_time, 0.0), Some(StageSection::Action) => (1.0, 1.0, anim_time, 0.0),
Some(StageSection::Recover) => (1.0, 1.0, 1.0, anim_time), Some(StageSection::Recover) => (1.0, 1.0, 1.0, anim_time),
_ => (0.0, 0.0, 0.0, 0.0), _ => (0.0, 0.0, 0.0, 0.0),

View File

@ -28,7 +28,7 @@ impl Animation for ShootAnimation {
const UPDATE_FN: &'static [u8] = b"biped_large_shoot\0"; const UPDATE_FN: &'static [u8] = b"biped_large_shoot\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_shoot")] #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_shoot")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
( (
(active_tool_kind, active_tool_spec), (active_tool_kind, active_tool_spec),
@ -39,7 +39,7 @@ impl Animation for ShootAnimation {
_global_time, _global_time,
stage_section, stage_section,
acc_vel, acc_vel,
): Self::Dependency<'a>, ): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
rate: &mut f32, rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -20,9 +20,9 @@ impl Animation for SpinAnimation {
const UPDATE_FN: &'static [u8] = b"biped_large_spin\0"; const UPDATE_FN: &'static [u8] = b"biped_large_spin\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_spin")] #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_spin")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(active_tool_kind, _second_tool_kind, _global_time, stage_section): Self::Dependency<'a>, (active_tool_kind, _second_tool_kind, _global_time, stage_section): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
rate: &mut f32, rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -22,9 +22,9 @@ impl Animation for SpinMeleeAnimation {
const UPDATE_FN: &'static [u8] = b"biped_large_spinmelee\0"; const UPDATE_FN: &'static [u8] = b"biped_large_spinmelee\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_spinmelee")] #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_spinmelee")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(active_tool_kind, _second_tool_kind, velocity, _global_time, stage_section, acc_vel): Self::Dependency<'a>, (active_tool_kind, _second_tool_kind, velocity, _global_time, stage_section, acc_vel): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
rate: &mut f32, rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -26,7 +26,7 @@ impl Animation for SpriteSummonAnimation {
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_sprite_summon")] #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_sprite_summon")]
#[allow(clippy::single_match)] // TODO: Pending review in #587 #[allow(clippy::single_match)] // TODO: Pending review in #587
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
( (
(active_tool_kind, active_tool_spec), (active_tool_kind, active_tool_spec),
@ -34,7 +34,7 @@ impl Animation for SpriteSummonAnimation {
_global_time, _global_time,
velocity, velocity,
stage_section, stage_section,
): Self::Dependency<'a>, ): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
rate: &mut f32, rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -23,10 +23,10 @@ impl Animation for StunnedAnimation {
const UPDATE_FN: &'static [u8] = b"biped_large_stunned\0"; const UPDATE_FN: &'static [u8] = b"biped_large_stunned\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_stunned")] #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_stunned")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
((active_tool_kind, active_tool_spec), velocity, acc_vel, stage_section): Self::Dependency< ((active_tool_kind, active_tool_spec), velocity, acc_vel, stage_section): Self::Dependency<
'a, '_,
>, >,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,

View File

@ -25,7 +25,7 @@ impl Animation for SummonAnimation {
const UPDATE_FN: &'static [u8] = b"biped_large_summon\0"; const UPDATE_FN: &'static [u8] = b"biped_large_summon\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_summon")] #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_summon")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
( (
(active_tool_kind, active_tool_spec), (active_tool_kind, active_tool_spec),
@ -34,7 +34,7 @@ impl Animation for SummonAnimation {
_global_time, _global_time,
stage_section, stage_section,
acc_vel, acc_vel,
): Self::Dependency<'a>, ): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
rate: &mut f32, rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -21,9 +21,9 @@ impl Animation for WieldAnimation {
const UPDATE_FN: &'static [u8] = b"biped_large_wield\0"; const UPDATE_FN: &'static [u8] = b"biped_large_wield\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_wield")] #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_wield")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
((active_tool_kind, active_tool_spec), _second_tool, velocity, global_time, acc_vel): Self::Dependency<'a>, ((active_tool_kind, active_tool_spec), _second_tool, velocity, global_time, acc_vel): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -28,7 +28,7 @@ impl Animation for AlphaAnimation {
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_small_alpha")] #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_small_alpha")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
( (
active_tool_kind, active_tool_kind,
@ -40,7 +40,7 @@ impl Animation for AlphaAnimation {
_acc_vel, _acc_vel,
stage_section, stage_section,
timer, timer,
): Self::Dependency<'a>, ): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -28,7 +28,7 @@ impl Animation for BeamAnimation {
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_small_beam")] #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_small_beam")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
( (
_active_tool_kind, _active_tool_kind,
@ -40,7 +40,7 @@ impl Animation for BeamAnimation {
_acc_vel, _acc_vel,
stage_section, stage_section,
_timer, _timer,
): Self::Dependency<'a>, ): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -27,7 +27,7 @@ impl Animation for DashAnimation {
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_small_dash")] #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_small_dash")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
( (
velocity, velocity,
@ -38,7 +38,7 @@ impl Animation for DashAnimation {
_acc_vel, _acc_vel,
stage_section, stage_section,
_timer, _timer,
): Self::Dependency<'a>, ): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -17,9 +17,9 @@ impl Animation for IdleAnimation {
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_small_idle")] #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_small_idle")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(_velocity, _orientation, _last_ori, _global_time, _avg_vel): Self::Dependency<'a>, (_velocity, _orientation, _last_ori, _global_time, _avg_vel): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -17,9 +17,9 @@ impl Animation for RunAnimation {
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_small_run")] #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_small_run")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(velocity, orientation, last_ori, global_time, _avg_vel, acc_vel): Self::Dependency<'a>, (velocity, orientation, last_ori, global_time, _avg_vel, acc_vel): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
rate: &mut f32, rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -28,7 +28,7 @@ impl Animation for ShockwaveAnimation {
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_small_shockwave")] #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_small_shockwave")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
( (
active_tool_kind, active_tool_kind,
@ -40,7 +40,7 @@ impl Animation for ShockwaveAnimation {
_acc_vel, _acc_vel,
stage_section, stage_section,
timer, timer,
): Self::Dependency<'a>, ): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -28,7 +28,7 @@ impl Animation for ShootAnimation {
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_small_shoot")] #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_small_shoot")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
( (
active_tool_kind, active_tool_kind,
@ -40,7 +40,7 @@ impl Animation for ShootAnimation {
_acc_vel, _acc_vel,
stage_section, stage_section,
_timer, _timer,
): Self::Dependency<'a>, ): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -27,7 +27,7 @@ impl Animation for SpinMeleeAnimation {
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_small_spinmelee")] #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_small_spinmelee")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
( (
active_tool_kind, active_tool_kind,
@ -39,7 +39,7 @@ impl Animation for SpinMeleeAnimation {
_acc_vel, _acc_vel,
stage_section, stage_section,
_timer, _timer,
): Self::Dependency<'a>, ): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -29,7 +29,7 @@ impl Animation for StunnedAnimation {
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_small_stunned")] #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_small_stunned")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
( (
active_tool_kind, active_tool_kind,
@ -42,7 +42,7 @@ impl Animation for StunnedAnimation {
wield_status, wield_status,
stage_section, stage_section,
timer, timer,
): Self::Dependency<'a>, ): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -28,7 +28,7 @@ impl Animation for SummonAnimation {
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_small_summon")] #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_small_summon")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
( (
active_tool_kind, active_tool_kind,
@ -40,7 +40,7 @@ impl Animation for SummonAnimation {
_acc_vel, _acc_vel,
stage_section, stage_section,
timer, timer,
): Self::Dependency<'a>, ): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -26,9 +26,9 @@ impl Animation for WieldAnimation {
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_small_wield")] #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_small_wield")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(active_tool_kind, velocity, _orientation, _last_ori, _global_time, _avg_vel, acc_vel): Self::Dependency<'a>, (active_tool_kind, velocity, _orientation, _last_ori, _global_time, _avg_vel, acc_vel): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -14,9 +14,9 @@ impl Animation for AlphaAnimation {
const UPDATE_FN: &'static [u8] = b"bird_large_alpha\0"; const UPDATE_FN: &'static [u8] = b"bird_large_alpha\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_alpha")] #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_alpha")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(stage_section, global_time, timer, orientation, last_ori, on_ground): Self::Dependency<'a>, (stage_section, global_time, timer, orientation, last_ori, on_ground): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -25,9 +25,9 @@ impl Animation for BreatheAnimation {
const UPDATE_FN: &'static [u8] = b"bird_large_breathe\0"; const UPDATE_FN: &'static [u8] = b"bird_large_breathe\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_breathe")] #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_breathe")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(velocity,global_time, _orientation, _last_ori, stage_section, timer, look_dir, on_ground): Self::Dependency<'a>, (velocity,global_time, _orientation, _last_ori, stage_section, timer, look_dir, on_ground): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -24,9 +24,9 @@ impl Animation for DashAnimation {
const UPDATE_FN: &'static [u8] = b"bird_large_dash\0"; const UPDATE_FN: &'static [u8] = b"bird_large_dash\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_dash")] #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_dash")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(velocity, orientation, last_ori, acc_vel, stage_section, global_time, timer): Self::Dependency<'a>, (velocity, orientation, last_ori, acc_vel, stage_section, global_time, timer): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
rate: &mut f32, rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -14,9 +14,9 @@ impl Animation for FeedAnimation {
const UPDATE_FN: &'static [u8] = b"bird_large_feed\0"; const UPDATE_FN: &'static [u8] = b"bird_large_feed\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_feed")] #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_feed")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
global_time: Self::Dependency<'a>, global_time: Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -13,9 +13,9 @@ impl Animation for FlyAnimation {
const UPDATE_FN: &'static [u8] = b"bird_large_fly\0"; const UPDATE_FN: &'static [u8] = b"bird_large_fly\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_fly")] #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_fly")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(velocity, orientation, last_ori): Self::Dependency<'a>, (velocity, orientation, last_ori): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -14,9 +14,9 @@ impl Animation for IdleAnimation {
const UPDATE_FN: &'static [u8] = b"bird_large_idle\0"; const UPDATE_FN: &'static [u8] = b"bird_large_idle\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_idle")] #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_idle")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
global_time: Self::Dependency<'a>, global_time: Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -14,9 +14,9 @@ impl Animation for RunAnimation {
const UPDATE_FN: &'static [u8] = b"bird_large_run\0"; const UPDATE_FN: &'static [u8] = b"bird_large_run\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_run")] #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_run")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(velocity, orientation, last_ori, avg_vel, acc_vel): Self::Dependency<'a>, (velocity, orientation, last_ori, avg_vel, acc_vel): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
rate: &mut f32, rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -14,9 +14,9 @@ impl Animation for ShockwaveAnimation {
const UPDATE_FN: &'static [u8] = b"bird_large_shockwave\0"; const UPDATE_FN: &'static [u8] = b"bird_large_shockwave\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_shockwave")] #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_shockwave")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(stage_section, on_ground): Self::Dependency<'a>, (stage_section, on_ground): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -16,9 +16,9 @@ impl Animation for ShootAnimation {
const UPDATE_FN: &'static [u8] = b"bird_large_shoot\0"; const UPDATE_FN: &'static [u8] = b"bird_large_shoot\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_shoot")] #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_shoot")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(velocity, global_time, stage_section, timer, look_dir, on_ground): Self::Dependency<'a>, (velocity, global_time, stage_section, timer, look_dir, on_ground): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -14,9 +14,9 @@ impl Animation for StunnedAnimation {
const UPDATE_FN: &'static [u8] = b"bird_large_stunned\0"; const UPDATE_FN: &'static [u8] = b"bird_large_stunned\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_stunned")] #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_stunned")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(global_time, stage_section, timer): Self::Dependency<'a>, (global_time, stage_section, timer): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -16,9 +16,9 @@ impl Animation for SummonAnimation {
const UPDATE_FN: &'static [u8] = b"bird_large_summon\0"; const UPDATE_FN: &'static [u8] = b"bird_large_summon\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_summon")] #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_summon")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(global_time, stage_section, timer, look_dir, on_ground): Self::Dependency<'a>, (global_time, stage_section, timer, look_dir, on_ground): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
rate: &mut f32, rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -14,9 +14,9 @@ impl Animation for SwimAnimation {
const UPDATE_FN: &'static [u8] = b"bird_large_swim\0"; const UPDATE_FN: &'static [u8] = b"bird_large_swim\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_swim")] #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_swim")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
global_time: Self::Dependency<'a>, global_time: Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -15,9 +15,9 @@ impl Animation for FeedAnimation {
#[cfg_attr(feature = "be-dyn-lib", export_name = "bird_medium_feed")] #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_medium_feed")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
global_time: Self::Dependency<'a>, global_time: Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -14,9 +14,9 @@ impl Animation for FlyAnimation {
const UPDATE_FN: &'static [u8] = b"bird_medium_fly\0"; const UPDATE_FN: &'static [u8] = b"bird_medium_fly\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "bird_medium_fly")] #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_medium_fly")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
_global_time: Self::Dependency<'a>, _global_time: Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -15,9 +15,9 @@ impl Animation for IdleAnimation {
#[cfg_attr(feature = "be-dyn-lib", export_name = "bird_medium_idle")] #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_medium_idle")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
global_time: Self::Dependency<'a>, global_time: Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -14,9 +14,9 @@ impl Animation for RunAnimation {
const UPDATE_FN: &'static [u8] = b"bird_medium_run\0"; const UPDATE_FN: &'static [u8] = b"bird_medium_run\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "bird_medium_run")] #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_medium_run")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(_velocity, _global_time): Self::Dependency<'a>, (_velocity, _global_time): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -23,9 +23,9 @@ impl Animation for AlphaAnimation {
const UPDATE_FN: &'static [u8] = b"character_alpha\0"; const UPDATE_FN: &'static [u8] = b"character_alpha\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "character_alpha")] #[cfg_attr(feature = "be-dyn-lib", export_name = "character_alpha")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(hands, stage_section, ability_info): Self::Dependency<'a>, (hands, stage_section, ability_info): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
rate: &mut f32, rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -24,9 +24,9 @@ impl Animation for BeamAnimation {
const UPDATE_FN: &'static [u8] = b"character_beam\0"; const UPDATE_FN: &'static [u8] = b"character_beam\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "character_beam")] #[cfg_attr(feature = "be-dyn-lib", export_name = "character_beam")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(ability_info, hands, _global_time, velocity, stage_section): Self::Dependency<'a>, (ability_info, hands, _global_time, velocity, stage_section): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
rate: &mut f32, rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -24,10 +24,10 @@ impl Animation for BetaAnimation {
const UPDATE_FN: &'static [u8] = b"character_beta\0"; const UPDATE_FN: &'static [u8] = b"character_beta\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "character_beta")] #[cfg_attr(feature = "be-dyn-lib", export_name = "character_beta")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(hands, _ability_id, _velocity, _global_time, stage_section, ability_info): Self::Dependency< (hands, _ability_id, _velocity, _global_time, stage_section, ability_info): Self::Dependency<
'a, '_,
>, >,
anim_time: f32, anim_time: f32,
rate: &mut f32, rate: &mut f32,

View File

@ -27,7 +27,7 @@ impl Animation for BlockAnimation {
const UPDATE_FN: &'static [u8] = b"character_block\0"; const UPDATE_FN: &'static [u8] = b"character_block\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "character_block")] #[cfg_attr(feature = "be-dyn-lib", export_name = "character_block")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
( (
hands, hands,
@ -37,7 +37,7 @@ impl Animation for BlockAnimation {
ability_id, ability_id,
stage_section, stage_section,
_ability_info, _ability_info,
): Self::Dependency<'a>, ): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
rate: &mut f32, rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

View File

@ -25,9 +25,9 @@ impl Animation for ChargeswingAnimation {
const UPDATE_FN: &'static [u8] = b"character_chargeswing\0"; const UPDATE_FN: &'static [u8] = b"character_chargeswing\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "character_chargeswing")] #[cfg_attr(feature = "be-dyn-lib", export_name = "character_chargeswing")]
fn update_skeleton_inner<'a>( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(hands, ability_id, stage_section, ability_info): Self::Dependency<'a>, (hands, ability_id, stage_section, ability_info): Self::Dependency<'_>,
anim_time: f32, anim_time: f32,
rate: &mut f32, rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,

Some files were not shown because too many files have changed in this diff Show More