djust for changes in specs safety refactor

This commit is contained in:
Imbris 2023-09-15 16:30:54 -04:00
parent 5d311e13bd
commit 9c398cb06d
41 changed files with 164 additions and 125 deletions

58
Cargo.lock generated
View File

@ -353,12 +353,6 @@ dependencies = [
"syn 2.0.29",
]
[[package]]
name = "atom"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c9ff149ed9780025acfdb36862d35b28856bb693ceb451259a7164442f22fdc3"
[[package]]
name = "atomic-polyfill"
version = "0.1.11"
@ -2726,11 +2720,10 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
[[package]]
name = "hibitset"
version = "0.6.3"
version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "93a1bb8316a44459a7d14253c4d28dd7395cbd23cc04a68c46e851b8e46d64b1"
checksum = "f3ede5cfa60c958e60330d65163adbc4211e15a2653ad80eb0cce878de120121"
dependencies = [
"atom",
"rayon",
]
@ -3387,6 +3380,22 @@ dependencies = [
"libc",
]
[[package]]
name = "macro_rules_attribute"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf0c9b980bf4f3a37fd7b1c066941dd1b1d0152ce6ee6e8fe8c49b9f6810d862"
dependencies = [
"macro_rules_attribute-proc_macro",
"paste",
]
[[package]]
name = "macro_rules_attribute-proc_macro"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "58093314a45e00c77d5c508f76e77c3396afbbc0d01506e7fae47b018bac2b1d"
[[package]]
name = "malloc_buf"
version = "0.0.6"
@ -3814,6 +3823,27 @@ dependencies = [
"windows-sys 0.48.0",
]
[[package]]
name = "nougat"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "97b57b9ced431322f054fc673f1d3c7fa52d80efd9df74ad2fc759f044742510"
dependencies = [
"macro_rules_attribute",
"nougat-proc_macros",
]
[[package]]
name = "nougat-proc_macros"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c84f77a45e99a2f9b492695d99e1c23844619caa5f3e57647cffacad773ca257"
dependencies = [
"proc-macro2 1.0.66",
"quote 1.0.33",
"syn 1.0.109",
]
[[package]]
name = "ntapi"
version = "0.3.7"
@ -5639,12 +5669,13 @@ checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3"
[[package]]
name = "shred"
version = "0.14.1"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6aa4148ce950f367ede79bff6bb04bbf3c31317a1291315078ef60c080821a1"
checksum = "dc6b2cd1ccb08cf2b25d75c936e0cc9c8cb93c39a83814956da32653236338c0"
dependencies = [
"ahash 0.7.6",
"arrayvec 0.7.4",
"atomic_refcell",
"rayon",
"shred-derive",
"smallvec",
@ -5815,14 +5846,15 @@ dependencies = [
[[package]]
name = "specs"
version = "0.19.0"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad2e89cb8aba27bebf48a5a47b4889e7b317a08884d92cc36109d58992d41325"
checksum = "a60eabdfd5a80e458c3e7bcc9f1076d6ce3cc8ddb71d69691f00fc0de735a635"
dependencies = [
"ahash 0.7.6",
"crossbeam-queue",
"hibitset",
"log",
"nougat",
"rayon",
"serde",
"shred",

View File

@ -149,7 +149,7 @@ serde = { version = "1.0.118", features = ["derive"] }
serde_json = { version = "1.0.50" }
ron = { version = "0.8", default-features = false}
specs = { version = "0.19", features = ["nightly"] }
specs = { version = "0.20", features = ["nightly"] }
image = { version = "0.24", default-features = false, features = ["png"] }
rayon = { version = "1.5" }

View File

@ -10,7 +10,7 @@ pub use crate::error::Error;
pub use authc::AuthClientError;
pub use common_net::msg::ServerInfo;
pub use specs::{
join::Join, Builder, DispatcherBuilder, Entity as EcsEntity, ReadStorage, World, WorldExt,
Builder, DispatcherBuilder, Entity as EcsEntity, Join, LendJoin, ReadStorage, World, WorldExt,
};
use crate::addr::ConnectionArgs;

View File

@ -1,7 +1,7 @@
use super::track::UpdateTracker;
use common::{resources::Time, uid::Uid};
use serde::{de::DeserializeOwned, Deserialize, Serialize};
use specs::{Component, Entity, Join, ReadStorage, World, WorldExt};
use specs::{storage::AccessMut, Component, Entity, Join, ReadStorage, World, WorldExt};
use std::{
convert::{TryFrom, TryInto},
fmt::Debug,
@ -33,7 +33,7 @@ pub fn handle_insert<C: Component>(comp: C, entity: Entity, world: &World) {
/// Useful for implementing CompPacket trait
pub fn handle_modify<C: Component + Debug>(comp: C, entity: Entity, world: &World) {
if let Some(mut c) = world.write_storage::<C>().get_mut(entity) {
*c = comp
*c.access_mut() = comp
} else {
error!(
?comp,
@ -77,7 +77,7 @@ pub fn handle_interp_modify<C: InterpolatableComponent + Debug>(
) {
if let Some(mut interp_data) = world.write_storage::<C::InterpData>().get_mut(entity) {
let time = world.read_resource::<Time>().0;
comp.update_component(&mut interp_data, time, force_update);
comp.update_component(interp_data.access_mut(), time, force_update);
handle_modify(comp, entity, world);
} else {
error!(

View File

@ -2,7 +2,7 @@ use crate::{comp::Alignment, uid::Uid};
use hashbrown::HashMap;
use serde::{Deserialize, Serialize};
use slab::Slab;
use specs::{Component, DerefFlaggedStorage, Join};
use specs::{Component, DerefFlaggedStorage, Join, LendJoin};
use tracing::{error, warn};
// Primitive group system

View File

@ -2,7 +2,7 @@ use crate::comp::{Pos, Presence, Vel};
use common_base::span;
use hashbrown::{hash_map::DefaultHashBuilder, HashSet};
use indexmap::IndexMap;
use specs::{hibitset::BitSetLike, BitSet, Entities, Join, ReadStorage};
use specs::{hibitset::BitSetLike, BitSet, Entities, Join, LendJoin, ReadStorage};
use vek::*;
pub enum Event {

View File

@ -17,8 +17,8 @@ use common_ecs::{Job, Origin, ParMode, Phase, System};
use rand::Rng;
use rayon::iter::ParallelIterator;
use specs::{
shred::ResourceId, Entities, Join, ParJoin, Read, ReadExpect, ReadStorage, SystemData, World,
WriteStorage,
shred::ResourceId, Entities, Join, LendJoin, ParJoin, Read, ReadExpect, ReadStorage,
SystemData, World, WriteStorage,
};
use std::time::Duration;
use vek::*;
@ -311,11 +311,13 @@ impl<'a> System<'a> for Sys {
// Set start time on new beams
// This change doesn't need to be recorded as it is not sent to the client
beam_segments.set_event_emission(false);
(&mut beam_segments).join().for_each(|mut beam_segment| {
if beam_segment.creation.is_none() {
beam_segment.creation = Some(time);
}
});
(&mut beam_segments)
.lend_join()
.for_each(|mut beam_segment| {
if beam_segment.creation.is_none() {
beam_segment.creation = Some(time);
}
});
beam_segments.set_event_emission(true);
}
}

View File

@ -22,8 +22,8 @@ use common_base::prof_span;
use common_ecs::{Job, Origin, ParMode, Phase, System};
use rayon::iter::ParallelIterator;
use specs::{
shred::ResourceId, Entities, Entity, Join, ParJoin, Read, ReadExpect, ReadStorage, SystemData,
World, WriteStorage,
shred::ResourceId, Entities, Entity, LendJoin, ParJoin, Read, ReadExpect, ReadStorage,
SystemData, World, WriteStorage,
};
#[derive(SystemData)]
@ -120,7 +120,7 @@ impl<'a> System<'a> for Sys {
}
}
for (entity, buff_comp, mut stat, body, health, energy, physics_state) in (
let buff_join = (
&read_data.entities,
&read_data.buffs,
&mut stats,
@ -129,8 +129,9 @@ impl<'a> System<'a> for Sys {
&read_data.energies,
read_data.physics_states.maybe(),
)
.join()
{
.lend_join();
buff_join.for_each(|comps| {
let (entity, buff_comp, mut stat, body, health, energy, physics_state) = comps;
// Apply buffs to entity based off of their current physics_state
if let Some(physics_state) = physics_state {
if matches!(
@ -459,7 +460,7 @@ impl<'a> System<'a> for Sys {
},
});
}
}
});
// Turned back to true
stats.set_event_emission(true);
}

View File

@ -1,5 +1,5 @@
use specs::{
shred::ResourceId, Entities, Join, LazyUpdate, Read, ReadExpect, ReadStorage, SystemData,
shred::ResourceId, Entities, LazyUpdate, LendJoin, Read, ReadExpect, ReadStorage, SystemData,
World, WriteStorage,
};
@ -105,24 +105,7 @@ impl<'a> System<'a> for Sys {
let mut server_events = Vec::new();
let mut output_events = OutputEvents::new(&mut local_events, &mut server_events);
for (
entity,
uid,
mut char_state,
character_activity,
pos,
vel,
ori,
mass,
density,
energy,
inventory,
controller,
health,
body,
(physics, scale, stat, skill_set, active_abilities, is_rider),
combo,
) in (
let join = (
&read_data.entities,
&read_data.uids,
&mut character_states,
@ -147,12 +130,30 @@ impl<'a> System<'a> for Sys {
),
read_data.combos.maybe(),
)
.join()
{
.lend_join();
join.for_each(|comps| {
let (
entity,
uid,
mut char_state,
character_activity,
pos,
vel,
ori,
mass,
density,
energy,
inventory,
controller,
health,
body,
(physics, scale, stat, skill_set, active_abilities, is_rider),
combo,
) = comps;
// Being dead overrides all other states
if health.map_or(false, |h| h.is_dead) {
// Do nothing
continue;
return;
}
// Enter stunned state if poise damage is enough
@ -230,7 +231,7 @@ impl<'a> System<'a> for Sys {
if is_rider.is_some() && !join_struct.char_state.can_perform_mounted() {
// TODO: A better way to swap between mount inputs and rider inputs
*join_struct.char_state = CharacterState::Idle(idle::Data::default());
continue;
return;
}
let j = JoinData::new(
@ -244,7 +245,7 @@ impl<'a> System<'a> for Sys {
let state_update = j.character.behavior(&j, &mut output_events);
Self::publish_state_update(&mut join_struct, state_update, &mut output_events);
}
});
local_emitter.append_vec(local_events);
server_emitter.append_vec(server_events);

View File

@ -18,7 +18,7 @@ use common::{
use common_ecs::{Job, Origin, Phase, System};
use itertools::Itertools;
use specs::{
shred::ResourceId, Entities, Join, Read, ReadExpect, ReadStorage, SystemData, World,
shred::ResourceId, Entities, Join, LendJoin, Read, ReadExpect, ReadStorage, SystemData, World,
WriteStorage,
};
use vek::*;

View File

@ -6,7 +6,7 @@ use common::{
uid::IdMaps,
};
use common_ecs::{Job, Origin, Phase, System};
use specs::{Entities, Join, Read, ReadExpect, ReadStorage, WriteStorage};
use specs::{Entities, Join, LendJoin, Read, ReadExpect, ReadStorage, WriteStorage};
use tracing::error;
use vek::*;

View File

@ -23,8 +23,8 @@ use common_ecs::{Job, Origin, ParMode, Phase, PhysicsMetrics, System};
use rayon::iter::ParallelIterator;
use specs::{
shred::{ResourceId, World},
Entities, Entity, Join, ParJoin, Read, ReadExpect, ReadStorage, SystemData, Write, WriteExpect,
WriteStorage,
Entities, Entity, Join, LendJoin, ParJoin, Read, ReadExpect, ReadStorage, SystemData, Write,
WriteExpect, WriteStorage,
};
use std::ops::Range;
use vek::*;

View File

@ -15,7 +15,7 @@ use common::{
use common_ecs::{Job, Origin, Phase, System};
use rand::Rng;
use specs::{
shred::ResourceId, Entities, Join, Read, ReadStorage, SystemData, World, WriteStorage,
shred::ResourceId, Entities, Join, LendJoin, Read, ReadStorage, SystemData, World, WriteStorage,
};
use vek::*;
@ -264,7 +264,7 @@ impl<'a> System<'a> for Sys {
// Set start time on new shockwaves
// This change doesn't need to be recorded as it is not sent to the client
shockwaves.set_event_emission(false);
(&mut shockwaves).join().for_each(|mut shockwave| {
(&mut shockwaves).lend_join().for_each(|mut shockwave| {
if shockwave.creation.is_none() {
shockwave.creation = Some(time);
}

View File

@ -12,7 +12,7 @@ use common::{
};
use common_ecs::{Job, Origin, Phase, System};
use specs::{
shred::ResourceId, Entities, Join, Read, ReadExpect, ReadStorage, SystemData, World, Write,
shred::ResourceId, Entities, LendJoin, Read, ReadExpect, ReadStorage, SystemData, World, Write,
WriteStorage,
};
@ -70,7 +70,7 @@ impl<'a> System<'a> for Sys {
let dt = read_data.dt.0;
// Update stats
for (entity, stats, mut health, pos, mut energy, inventory) in (
let join = (
&read_data.entities,
&stats,
&mut healths,
@ -78,8 +78,8 @@ impl<'a> System<'a> for Sys {
&mut energies,
read_data.inventories.maybe(),
)
.join()
{
.lend_join();
join.for_each(|(entity, stats, mut health, pos, mut energy, inventory)| {
let set_dead = { health.should_die() && !health.is_dead };
if set_dead {
@ -112,17 +112,17 @@ impl<'a> System<'a> for Sys {
// update to the client.
energy.update_internal_integer_maximum(new_max);
}
}
});
// Apply effects from leveling skills
for (mut skill_set, mut health, mut energy, body) in (
let join = (
&mut skill_sets,
&mut healths,
&mut energies,
&read_data.bodies,
)
.join()
{
.lend_join();
join.for_each(|(mut skill_set, mut health, mut energy, body)| {
if skill_set.modify_health {
let health_level = skill_set
.skill_level(Skill::General(GeneralSkill::HealthIncrease))
@ -137,12 +137,11 @@ impl<'a> System<'a> for Sys {
energy.update_max_energy(*body, energy_level);
skill_set.modify_energy = false;
}
}
});
// Update energies and poises
for (character_state, mut energy, mut poise) in
(&read_data.char_states, &mut energies, &mut poises).join()
{
let join = (&read_data.char_states, &mut energies, &mut poises).lend_join();
join.for_each(|(character_state, mut energy, mut poise)| {
match character_state {
// Sitting accelerates recharging energy the most
CharacterState::Sit => {
@ -207,15 +206,17 @@ impl<'a> System<'a> for Sys {
| CharacterState::UseItem(_)
| CharacterState::SpriteInteract(_) => {},
}
}
});
// Decay combo
for (_, mut combo) in (&read_data.entities, &mut combos).join() {
if combo.counter() > 0
&& read_data.time.0 - combo.last_increase() > comp::combo::COMBO_DECAY_START
{
combo.reset();
}
}
(&read_data.entities, &mut combos)
.lend_join()
.for_each(|(_, mut combo)| {
if combo.counter() > 0
&& read_data.time.0 - combo.last_increase() > comp::combo::COMBO_DECAY_START
{
combo.reset();
}
});
}
}

View File

@ -59,7 +59,7 @@ use core::{cmp::Ordering, convert::TryFrom};
use hashbrown::{HashMap, HashSet};
use humantime::Duration as HumanDuration;
use rand::{thread_rng, Rng};
use specs::{storage::StorageEntry, Builder, Entity as EcsEntity, Join, WorldExt};
use specs::{storage::StorageEntry, Builder, Entity as EcsEntity, Join, LendJoin, WorldExt};
use std::{fmt::Write, ops::DerefMut, str::FromStr, sync::Arc};
use vek::*;
use wiring::{Circuit, Wire, WireNode, WiringAction, WiringActionEffect, WiringElement};

View File

@ -42,7 +42,7 @@ use common_net::{msg::ServerGeneral, sync::WorldSyncExt};
use common_state::{AreasContainer, BlockChange, NoDurabilityArea};
use hashbrown::HashSet;
use rand::Rng;
use specs::{join::Join, Builder, Entity as EcsEntity, Entity, WorldExt};
use specs::{Builder, Entity as EcsEntity, Entity, Join, LendJoin, WorldExt};
use std::{collections::HashMap, iter, sync::Arc, time::Duration};
use tracing::{debug, error, warn};
use vek::{Vec2, Vec3};

View File

@ -100,7 +100,7 @@ use persistence::{
};
use prometheus::Registry;
use prometheus_hyper::Server as PrometheusServer;
use specs::{join::Join, Builder, Entity as EcsEntity, Entity, WorldExt};
use specs::{Builder, Entity as EcsEntity, Entity, Join, LendJoin, WorldExt};
use std::{
i32,
ops::{Deref, DerefMut},

View File

@ -19,7 +19,7 @@ use rtsim::data::{
npc::{Profession, SimulationMode},
Npc, Sites,
};
use specs::{Entities, Join, Read, ReadExpect, ReadStorage, WriteExpect, WriteStorage};
use specs::{Entities, Join, LendJoin, Read, ReadExpect, ReadStorage, WriteExpect, WriteStorage};
use std::{sync::Arc, time::Duration};
use tracing::error;
use world::site::settlement::trader_loadout;

View File

@ -19,7 +19,7 @@ use common_base::prof_span;
use common_ecs::{Job, Origin, ParMode, Phase, System};
use rand::thread_rng;
use rayon::iter::ParallelIterator;
use specs::{Join, ParJoin, Read, WriteStorage};
use specs::{LendJoin, ParJoin, Read, WriteStorage};
/// This system will allow NPCs to modify their controller
#[derive(Default)]

View File

@ -16,7 +16,7 @@ use common::{
use common_ecs::{Job, Origin, Phase, System};
use common_net::{msg::ServerGeneral, sync::CompSyncPackage};
use itertools::Either;
use specs::{Entities, Join, Read, ReadExpect, ReadStorage, Write, WriteStorage};
use specs::{Entities, Join, LendJoin, Read, ReadExpect, ReadStorage, Write, WriteStorage};
use vek::*;
/// This system will send physics updates to the client
@ -347,7 +347,8 @@ impl<'a> System<'a> for Sys {
}
// Update the last physics components for each entity
for (_, &pos, vel, ori, last_pos, last_vel, last_ori) in (
(
&entities,
&positions,
velocities.maybe(),
@ -356,12 +357,12 @@ impl<'a> System<'a> for Sys {
last_vel.entries(),
last_ori.entries(),
)
.join()
{
last_pos.replace(Last(pos));
vel.and_then(|&v| last_vel.replace(Last(v)));
ori.and_then(|&o| last_ori.replace(Last(o)));
}
.lend_join()
.for_each(|(_, &pos, vel, ori, last_pos, last_vel, last_ori)| {
last_pos.replace(Last(pos));
vel.and_then(|&v| last_vel.replace(Last(v)));
ori.and_then(|&o| last_ori.replace(Last(o)));
});
// Handle entity deletion in regions that don't exist in RegionMap
// (theoretically none)

View File

@ -8,7 +8,7 @@ use common::{
use common_ecs::{Job, Origin, Phase, System};
use common_net::msg::{ClientGeneral, ServerGeneral};
use rayon::prelude::*;
use specs::{Entities, Join, ParJoin, Read, ReadStorage, WriteStorage};
use specs::{Entities, LendJoin, ParJoin, Read, ReadStorage, WriteStorage};
use tracing::{debug, error, warn};
impl Sys {

View File

@ -19,7 +19,7 @@ use common_net::msg::{ClientGeneral, ServerGeneral};
use common_state::{AreasContainer, BlockChange, BuildArea};
use core::mem;
use rayon::prelude::*;
use specs::{Entities, Join, Read, ReadExpect, ReadStorage, Write, WriteStorage};
use specs::{Entities, Join, LendJoin, Read, ReadExpect, ReadStorage, Write, WriteStorage};
use std::{borrow::Cow, time::Instant};
use tracing::{debug, trace, warn};
use vek::*;

View File

@ -24,8 +24,8 @@ use itertools::Either;
use plugin_api::Health;
use rayon::prelude::*;
use specs::{
shred::ResourceId, Entities, Join, ParJoin, Read, ReadExpect, ReadStorage, SystemData, World,
WriteStorage,
shred::ResourceId, Entities, Join, LendJoin, ParJoin, Read, ReadExpect, ReadStorage,
SystemData, World, WriteStorage,
};
use tracing::{debug, info, trace, warn};

View File

@ -12,7 +12,7 @@ use common::{
use common_ecs::{Job, Origin, ParMode, Phase, System};
use common_net::msg::{ClientGeneral, ServerGeneral};
use rayon::prelude::*;
use specs::{Entities, Join, Read, ReadExpect, ReadStorage, Write, WriteStorage};
use specs::{Entities, Join, LendJoin, Read, ReadExpect, ReadStorage, Write, WriteStorage};
use tracing::{debug, trace};
/// This system will handle new messages from clients

View File

@ -8,7 +8,7 @@ use common::{
CachedSpatialGrid, Damage, DamageKind, DamageSource, Explosion, RadiusEffect,
};
use common_ecs::{Job, Origin, Phase, System};
use specs::{Entities, Join, Read, ReadStorage};
use specs::{Entities, Join, LendJoin, Read, ReadStorage};
use vek::Rgb;
/// This system is responsible for handling misc object behaviours
@ -195,7 +195,7 @@ impl<'a> System<'a> for Sys {
.in_circle_aabr(pos.0.xy(), TELEPORTER_RADIUS)
.any(|entity| {
(&positions, &teleporting)
.join()
.lend_join()
.get(entity, &entities)
.map_or(false, |(teleporter_pos, _)| {
pos.0.distance_squared(teleporter_pos.0)

View File

@ -8,7 +8,7 @@ use common::{
uid::Uid,
};
use common_ecs::{Job, Origin, Phase, System};
use specs::{Join, ReadStorage, Write, WriteExpect};
use specs::{Join, LendJoin, ReadStorage, Write, WriteExpect};
use tracing::error;
#[derive(Default)]

View File

@ -13,7 +13,8 @@ use common::{
use common_ecs::{Job, Origin, Phase, System};
use common_net::msg::ServerGeneral;
use specs::{
Entities, Join, Read, ReadExpect, ReadStorage, SystemData, World, WorldExt, WriteStorage,
Entities, Join, LendJoin, Read, ReadExpect, ReadStorage, SystemData, World, WorldExt,
WriteStorage,
};
use tracing::{debug, error};
use vek::*;

View File

@ -8,7 +8,7 @@ use common::{
CachedSpatialGrid,
};
use common_ecs::{Origin, Phase, System};
use specs::{Entities, Join, Read, ReadStorage, WriteStorage};
use specs::{Entities, Join, LendJoin, Read, ReadStorage, WriteStorage};
use vek::Vec3;
const MAX_AGGRO_DIST: f32 = 200.; // If an entity further than this is aggroed at a player, the portal will still work
@ -109,7 +109,7 @@ impl<'a> System<'a> for Sys {
.in_circle_aabr(position.0.xy(), PET_TELEPORT_RADIUS)
.filter_map(|entity| {
(&entities, &positions, &alignments)
.join()
.lend_join()
.get(entity, &entities)
})
.filter_map(|(nearby_entity, entity_position, alignment)| {

View File

@ -32,8 +32,8 @@ use core::cmp::Reverse;
use itertools::Itertools;
use rayon::{iter::Either, prelude::*};
use specs::{
storage::GenericReadStorage, Entities, Entity, Join, ParJoin, Read, ReadExpect, ReadStorage,
Write, WriteExpect, WriteStorage,
storage::GenericReadStorage, Entities, Entity, Join, LendJoin, ParJoin, Read, ReadExpect,
ReadStorage, Write, WriteExpect, WriteStorage,
};
use std::sync::Arc;
use vek::*;

View File

@ -5,7 +5,7 @@ use common::{
};
use common_ecs::{Job, Origin, Phase, System};
use common_net::msg::{Notification, ServerGeneral};
use specs::{Entities, Join, Read, ReadStorage, WriteStorage};
use specs::{Entities, Join, LendJoin, Read, ReadStorage, WriteStorage};
/// Cooldown time (in seconds) for "Waypoint Saved" notifications
const NOTIFY_TIME: f64 = 10.0;

View File

@ -8,8 +8,8 @@ use common_ecs::{Job, Origin, Phase, System};
use common_state::BlockChange;
use hashbrown::HashMap;
use specs::{
join::Join, shred::ResourceId, Entities, Entity, Read, ReadStorage, SystemData, World, Write,
WriteStorage,
shred::ResourceId, Entities, Entity, Join, LendJoin, Read, ReadStorage, SystemData, World,
Write, WriteStorage,
};
#[derive(SystemData)]
@ -106,7 +106,7 @@ impl<'a> System<'a> for Sys {
(&mut light_emitters).maybe(),
read_data.pos.maybe(),
)
.join()
.lend_join()
.for_each(
|(entity, wiring_element, physics_state, mut light_emitter, pos)| {
wiring_element

View File

@ -8,7 +8,7 @@ mod character_states;
mod experimental_shaders;
mod widgets;
use client::{Client, Join, World, WorldExt};
use client::{Client, Join, LendJoin, World, WorldExt};
use common::{
cmd::ServerChatCommand,
comp,

View File

@ -19,7 +19,7 @@ use common::{
};
use common_state::State;
use hashbrown::HashMap;
use specs::{Entity as EcsEntity, Join, WorldExt};
use specs::{Entity as EcsEntity, Join, LendJoin, WorldExt};
use std::time::{Duration, Instant};
#[derive(Clone)]

View File

@ -16,7 +16,7 @@ use common::{
};
use common_state::State;
use hashbrown::HashMap;
use specs::{Entity as EcsEntity, Join, WorldExt};
use specs::{Entity as EcsEntity, Join, LendJoin, WorldExt};
use std::time::{Duration, Instant};
use vek::*;

View File

@ -130,7 +130,7 @@ use conrod_core::{
use hashbrown::{HashMap, HashSet};
use i18n::Localization;
use rand::Rng;
use specs::{Entity as EcsEntity, Join, WorldExt};
use specs::{Entity as EcsEntity, Join, LendJoin, WorldExt};
use std::{
borrow::Cow,
cmp::Ordering,

View File

@ -62,7 +62,7 @@ use core::{
};
use guillotiere::AtlasAllocator;
use hashbrown::HashMap;
use specs::{Entity as EcsEntity, Join, LazyUpdate, WorldExt};
use specs::{Entity as EcsEntity, Join, LazyUpdate, LendJoin, WorldExt};
use std::sync::Arc;
use treeculler::{BVol, BoundingSphere};
use vek::*;

View File

@ -42,7 +42,7 @@ use common_state::State;
use comp::item::Reagent;
use hashbrown::HashMap;
use num::traits::{Float, FloatConst};
use specs::{Entity as EcsEntity, Join, WorldExt};
use specs::{Entity as EcsEntity, Join, LendJoin, WorldExt};
use vek::*;
const ZOOM_CAP_PLAYER: f32 = 1000.0;

View File

@ -26,7 +26,7 @@ use common::{
use common_base::span;
use hashbrown::HashMap;
use rand::prelude::*;
use specs::{Join, WorldExt};
use specs::{Join, LendJoin, WorldExt};
use std::{
f32::consts::{PI, TAU},
time::Duration,

View File

@ -1,5 +1,5 @@
use ordered_float::OrderedFloat;
use specs::{Join, ReadStorage, WorldExt};
use specs::{Join, LendJoin, ReadStorage, WorldExt};
use vek::*;
use super::{
@ -228,7 +228,7 @@ pub(super) fn select_interactable(
is_riders.maybe(),
(stats.mask() | items.mask()).maybe(),
)
.join();
.lend_join();
let closest_interactable_entity = spacial_grid.0.in_circle_aabr(player_pos.xy(), MAX_PICKUP_RANGE)
.filter(|&e| e != player_entity) // skip the player's entity
@ -279,7 +279,7 @@ pub(super) fn select_interactable(
&ecs.read_storage::<comp::Collider>(),
);
let mut volumes_data = volumes_data.join();
let mut volumes_data = volumes_data.lend_join();
let volumes = spacial_grid.0.in_circle_aabr(player_pos.xy(), search_dist)
.filter(|&e| e != player_entity) // skip the player's entity

View File

@ -7,7 +7,7 @@ use std::{cell::RefCell, collections::HashSet, rc::Rc, result::Result, time::Dur
#[cfg(not(target_os = "macos"))]
use mumble_link::SharedLink;
use ordered_float::OrderedFloat;
use specs::{Join, WorldExt};
use specs::{Join, LendJoin, WorldExt};
use tracing::{error, info};
use vek::*;

View File

@ -1,4 +1,4 @@
use specs::{Join, WorldExt};
use specs::{Join, LendJoin, WorldExt};
use vek::*;
use client::{self, Client};