Fix respawn position

Former-commit-id: c4dabc71a1c7af538e2c30acbf463340a4618cc9
This commit is contained in:
timokoesters 2019-05-23 17:54:15 +02:00
parent 1826a2b4f9
commit 1dbca8b994
2 changed files with 6 additions and 3 deletions

View File

@ -19,9 +19,8 @@ const STATS_SYS: &str = "stats_sys";
pub fn add_local_systems(dispatch_builder: &mut DispatcherBuilder) {
dispatch_builder.add(agent::Sys, AGENT_SYS, &[]);
dispatch_builder.add(phys::Sys, PHYS_SYS, &[]);
dispatch_builder.add(action::Sys, ACTION_SYS, &[]);
dispatch_builder.add(inputs::Sys, INPUTS_SYS, &[]);
dispatch_builder.add(actions::Sys, ACTIONS_SYS, &[]);
dispatch_builder.add(inputs::Sys, INPUTS_SYS, &[]);
dispatch_builder.add(animation::Sys, ANIMATION_SYS, &[]);
dispatch_builder.add(stats::Sys, STATS_SYS, &[INPUTS_SYS]);
}

View File

@ -240,7 +240,11 @@ impl Server {
self.state.ecs_mut().write_storage::<comp::Respawn>().remove(entity);
self.state.write_component(entity, comp::Stats::default());
self.state.write_component(entity, comp::Actions::default());
self.state.write_component(entity, comp::phys::Pos(Vec3::new(0.0, 0.0, 64.0)));
self.state
.ecs_mut()
.write_storage::<comp::phys::Pos>()
.get_mut(entity)
.map(|pos| pos.0.z += 100.0);
self.state.write_component(entity, comp::phys::Vel(Vec3::zero()));
self.state.write_component(entity, comp::phys::ForceUpdate);
}