mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
clippy fixes
This commit is contained in:
parent
7fd255ec6c
commit
e0dbba0279
@ -194,7 +194,7 @@ impl CharacterBehavior for Data {
|
||||
rng.gen_range(-1.0..=1.0),
|
||||
0.0,
|
||||
))
|
||||
.map(|dir| comp::Ori::from(dir))
|
||||
.map(comp::Ori::from)
|
||||
.unwrap_or_default(),
|
||||
npc: NpcBuilder::new(stats, body, comp::Alignment::Owned(*data.uid))
|
||||
.with_skill_set(skill_set)
|
||||
|
@ -307,11 +307,10 @@ impl NpcLinks {
|
||||
if let Some(riders) = self.mount_map.get_mut(link.mount) {
|
||||
if link.is_steering && riders.steerer == Some(id) {
|
||||
riders.steerer = None;
|
||||
} else {
|
||||
if let Some((i, _)) = riders.riders.iter().enumerate().find(|(_, i)| **i == id) {
|
||||
riders.riders.remove(i);
|
||||
}
|
||||
} else if let Some((i, _)) = riders.riders.iter().enumerate().find(|(_, i)| **i == id) {
|
||||
riders.riders.remove(i);
|
||||
}
|
||||
|
||||
if riders.steerer.is_none() && riders.riders.is_empty() {
|
||||
self.mount_map.remove(link.mount);
|
||||
}
|
||||
@ -457,8 +456,8 @@ impl From<HopSlotMap<MountId, NpcLink>> for NpcLinks {
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<HopSlotMap<MountId, NpcLink>> for NpcLinks {
|
||||
fn into(self) -> HopSlotMap<MountId, NpcLink> { self.links }
|
||||
impl From<NpcLinks> for HopSlotMap<MountId, NpcLink> {
|
||||
fn from(other: NpcLinks) -> Self { other.links }
|
||||
}
|
||||
slotmap::new_key_type! {
|
||||
pub struct MountId;
|
||||
|
@ -790,7 +790,7 @@ impl StateExt for State {
|
||||
rng.gen_range(-1.0..=1.0),
|
||||
0.0,
|
||||
))
|
||||
.map(|dir| comp::Ori::from(dir))
|
||||
.map(comp::Ori::from)
|
||||
.unwrap_or_default();
|
||||
let pet_entity = self
|
||||
.create_npc(
|
||||
|
@ -218,7 +218,7 @@ impl<'a> System<'a> for Sys {
|
||||
rng.gen_range(-1.0..=1.0),
|
||||
0.0,
|
||||
))
|
||||
.map(|dir| comp::Ori::from(dir))
|
||||
.map(comp::Ori::from)
|
||||
.unwrap_or_default(),
|
||||
npc: NpcBuilder::new(stats, body, alignment)
|
||||
.with_skill_set(skill_set)
|
||||
|
Loading…
Reference in New Issue
Block a user