mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Sync CanBuild component, fix /build messages
This commit is contained in:
parent
bf748ae742
commit
7f08377001
@ -89,7 +89,7 @@ impl Component for OnGround {
|
||||
}
|
||||
|
||||
impl Component for CanBuild {
|
||||
type Storage = NullStorage<Self>;
|
||||
type Storage = FlaggedStorage<Self, NullStorage<Self>>;
|
||||
}
|
||||
|
||||
impl Component for Jumping {
|
||||
|
@ -22,6 +22,7 @@ sphynx::sum_type! {
|
||||
Ori(comp::Ori),
|
||||
Body(comp::Body),
|
||||
Player(comp::Player),
|
||||
CanBuild(comp::CanBuild),
|
||||
Stats(comp::Stats),
|
||||
}
|
||||
}
|
||||
@ -35,6 +36,7 @@ sphynx::sum_type! {
|
||||
Ori(PhantomData<comp::Ori>),
|
||||
Body(PhantomData<comp::Body>),
|
||||
Player(PhantomData<comp::Player>),
|
||||
CanBuild(PhantomData<comp::CanBuild>),
|
||||
Stats(PhantomData<comp::Stats>),
|
||||
}
|
||||
}
|
||||
|
@ -129,6 +129,7 @@ impl State {
|
||||
ecs.register_synced::<comp::Body>();
|
||||
ecs.register_synced::<comp::Player>();
|
||||
ecs.register_synced::<comp::Stats>();
|
||||
ecs.register_synced::<comp::CanBuild>();
|
||||
|
||||
// Register components synced by other means
|
||||
ecs.register::<comp::Pos>();
|
||||
@ -136,7 +137,6 @@ impl State {
|
||||
ecs.register::<comp::Ori>();
|
||||
ecs.register::<comp::MoveDir>();
|
||||
ecs.register::<comp::OnGround>();
|
||||
ecs.register::<comp::CanBuild>();
|
||||
ecs.register::<comp::Controller>();
|
||||
ecs.register::<comp::Attacking>();
|
||||
ecs.register::<comp::Wielding>();
|
||||
|
@ -413,7 +413,7 @@ fn handle_build(server: &mut Server, entity: EcsEntity, _args: String, _action:
|
||||
.remove(entity);
|
||||
server.clients.notify(
|
||||
entity,
|
||||
ServerMsg::Chat(String::from("Toggled on build mode!")),
|
||||
ServerMsg::Chat(String::from("Toggled off build mode!")),
|
||||
);
|
||||
}
|
||||
None => {
|
||||
@ -424,7 +424,7 @@ fn handle_build(server: &mut Server, entity: EcsEntity, _args: String, _action:
|
||||
.insert(entity, comp::CanBuild);
|
||||
server.clients.notify(
|
||||
entity,
|
||||
ServerMsg::Chat(String::from("Toggled off build mode!")),
|
||||
ServerMsg::Chat(String::from("Toggled on build mode!")),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user