Merge branch 'treeco/home-removes-waypoint' into 'master'

Made home command reset waypoint to world spawn

See merge request veloren/veloren!1520
This commit is contained in:
Joshua Barretto 2020-11-15 02:12:12 +00:00
commit d72c981808

View File

@ -374,7 +374,12 @@ fn handle_home(
.is_some() .is_some()
{ {
let home_pos = server.state.ecs().read_resource::<SpawnPoint>().0; let home_pos = server.state.ecs().read_resource::<SpawnPoint>().0;
let time = *server.state.ecs().read_resource::<common::state::Time>();
server.state.write_component(target, comp::Pos(home_pos)); server.state.write_component(target, comp::Pos(home_pos));
server
.state
.write_component(target, comp::Waypoint::new(home_pos, time));
server.state.write_component(target, comp::ForceUpdate); server.state.write_component(target, comp::ForceUpdate);
} else { } else {
server.notify_client( server.notify_client(