mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Temp fix for the home command
This commit is contained in:
parent
c83fd48e13
commit
cbb701f30d
@ -11,6 +11,14 @@ pub struct Waypoint {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Waypoint {
|
impl Waypoint {
|
||||||
|
// TODO: add actual fix and remove this method
|
||||||
|
pub fn temp_new(pos: Vec3<f32>, last_save: Time) -> Self {
|
||||||
|
Self {
|
||||||
|
pos: pos + Vec3::from(0.25f32).map(|e| e * rand::random::<f32>() - 0.25 / 2.0),
|
||||||
|
last_save,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn new(pos: Vec3<f32>, last_save: Time) -> Self { Self { pos, last_save } }
|
pub fn new(pos: Vec3<f32>, last_save: Time) -> Self { Self { pos, last_save } }
|
||||||
|
|
||||||
pub fn get_pos(&self) -> Vec3<f32> { self.pos }
|
pub fn get_pos(&self) -> Vec3<f32> { self.pos }
|
||||||
|
@ -379,7 +379,7 @@ fn handle_home(
|
|||||||
server.state.write_component(target, comp::Pos(home_pos));
|
server.state.write_component(target, comp::Pos(home_pos));
|
||||||
server
|
server
|
||||||
.state
|
.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);
|
server.state.write_component(target, comp::ForceUpdate);
|
||||||
} else {
|
} else {
|
||||||
server.notify_client(
|
server.notify_client(
|
||||||
@ -1208,7 +1208,7 @@ fn handle_waypoint(
|
|||||||
.state
|
.state
|
||||||
.ecs()
|
.ecs()
|
||||||
.write_storage::<comp::Waypoint>()
|
.write_storage::<comp::Waypoint>()
|
||||||
.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, ChatType::CommandInfo.server_msg("Waypoint saved!"));
|
||||||
server.notify_client(
|
server.notify_client(
|
||||||
client,
|
client,
|
||||||
|
Loading…
Reference in New Issue
Block a user