Skip to content

Commit 0a381a3

Browse files
fix: update Position/Yaw/Pitch even w/out ConnectionId (#652)
1 parent a9c6b81 commit 0a381a3

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

crates/hyperion/src/egress/sync_entity_state.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ impl Module for EntityStateSyncModule {
264264
&Position,
265265
&Yaw,
266266
&Pitch,
267-
&ConnectionId,
267+
?&ConnectionId,
268268
)
269269
.multi_threaded()
270270
.kind::<flecs::pipeline::OnStore>()
@@ -274,7 +274,7 @@ impl Module for EntityStateSyncModule {
274274
let run = || {
275275
let entity_id = VarInt(entity.minecraft_id());
276276

277-
let io = *io;
277+
let io = io.copied();
278278

279279
let world = entity.world();
280280

crates/hyperion/src/net/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,12 +391,14 @@ impl<P> Broadcast<'_, P> {
391391
}
392392

393393
/// Exclude a certain player from the broadcast. This can only be called once.
394-
pub fn exclude(self, exclude: ConnectionId) -> Self {
394+
pub fn exclude(self, exclude: impl Into<Option<ConnectionId>>) -> Self {
395+
let exclude = exclude.into();
396+
let exclude = exclude.map(|id| id.stream_id).unwrap_or_default();
395397
Broadcast {
396398
packet: self.packet,
397399
compose: self.compose,
398400
system_id: self.system_id,
399-
exclude: exclude.stream_id,
401+
exclude,
400402
}
401403
}
402404
}

0 commit comments

Comments
 (0)