mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
only have 1 Fn passed to tick fn
This commit is contained in:
parent
485a477503
commit
7348e399e0
@ -1419,8 +1419,14 @@ impl Client {
|
||||
}
|
||||
|
||||
// 4) Tick the client's LocalState
|
||||
self.state
|
||||
.tick(dt, add_local_systems, add_foreign_systems, true);
|
||||
self.state.tick(
|
||||
dt,
|
||||
|dispatch_builder| {
|
||||
add_local_systems(dispatch_builder);
|
||||
add_foreign_systems(dispatch_builder);
|
||||
},
|
||||
true,
|
||||
);
|
||||
// TODO: avoid emitting these in the first place
|
||||
self.state
|
||||
.ecs()
|
||||
|
@ -508,8 +508,7 @@ impl State {
|
||||
pub fn tick(
|
||||
&mut self,
|
||||
dt: Duration,
|
||||
add_local_systems: impl Fn(&mut DispatcherBuilder),
|
||||
add_foreign_systems: impl Fn(&mut DispatcherBuilder),
|
||||
add_systems: impl Fn(&mut DispatcherBuilder),
|
||||
update_terrain_and_regions: bool,
|
||||
) {
|
||||
span!(_guard, "tick", "State::tick");
|
||||
@ -532,8 +531,7 @@ impl State {
|
||||
let mut dispatch_builder =
|
||||
DispatcherBuilder::new().with_pool(Arc::clone(&self.thread_pool));
|
||||
// TODO: Consider alternative ways to do this
|
||||
add_local_systems(&mut dispatch_builder);
|
||||
add_foreign_systems(&mut dispatch_builder);
|
||||
add_systems(&mut dispatch_builder);
|
||||
// This dispatches all the systems in parallel.
|
||||
let mut dispatcher = dispatch_builder.build();
|
||||
drop(guard);
|
||||
|
@ -517,8 +517,8 @@ impl Server {
|
||||
// in sys/terrain.rs
|
||||
self.state.tick(
|
||||
dt,
|
||||
add_local_systems,
|
||||
|dispatcher_builder| {
|
||||
add_local_systems(dispatcher_builder);
|
||||
sys::msg::add_server_systems(dispatcher_builder);
|
||||
sys::add_server_systems(dispatcher_builder);
|
||||
#[cfg(feature = "worldgen")]
|
||||
|
Loading…
Reference in New Issue
Block a user