diff --git a/common/src/comp/location.rs b/common/src/comp/location.rs index af22683abf..4f18f81b8b 100644 --- a/common/src/comp/location.rs +++ b/common/src/comp/location.rs @@ -11,6 +11,14 @@ pub struct Waypoint { } impl Waypoint { + // TODO: add actual fix and remove this method + pub fn temp_new(pos: Vec3, last_save: Time) -> Self { + Self { + pos: pos + Vec3::from(0.25f32).map(|e| e * rand::random::() - 0.25 / 2.0), + last_save, + } + } + pub fn new(pos: Vec3, last_save: Time) -> Self { Self { pos, last_save } } pub fn get_pos(&self) -> Vec3 { self.pos } diff --git a/server/src/cmd.rs b/server/src/cmd.rs index ca69a78efb..15a7014827 100644 --- a/server/src/cmd.rs +++ b/server/src/cmd.rs @@ -379,7 +379,7 @@ fn handle_home( server.state.write_component(target, comp::Pos(home_pos)); server .state - .write_component(target, comp::Waypoint::new(home_pos, time)); + .write_component(target, comp::Waypoint::temp_new(home_pos, time)); server.state.write_component(target, comp::ForceUpdate); } else { server.notify_client( @@ -1208,7 +1208,7 @@ fn handle_waypoint( .state .ecs() .write_storage::() - .insert(target, comp::Waypoint::new(pos.0, *time)); + .insert(target, comp::Waypoint::temp_new(pos.0, *time)); server.notify_client(client, ChatType::CommandInfo.server_msg("Waypoint saved!")); server.notify_client( client,