From 21a70c8e97b606bf791a6e79b244b23e37d3883f Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Wed, 14 Oct 2026 23:45:53 +0200 Subject: [PATCH] LAN: a guest's entity id no longer takes the host's Hub::admit read the entity counter before incrementing it, while the game increments first (the current value is the last id in use). The first guest after Open to LAN got the host's own entity id, so its client took the host's AddEntity for itself and never showed the host. Co-Authored-By: Claude Opus 5.5 --- crates/horizon-client/src/lan/hub.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/horizon-client/src/lan/hub.rs b/crates/horizon-client/src/lan/hub.rs index 6811eb129..2486fd1a5 100644 --- a/crates/horizon-client/src/lan/hub.rs +++ b/crates/horizon-client/src/lan/hub.rs @@ -420,8 +420,10 @@ impl Hub { } fn admit(&mut self, j: super::Joined, ctx: &mut TickCtx) -> u32 { - let entity_id = *ctx.next_entity as i32; + // The game's ids are taken by incrementing first: the current value + // is the last id in use (the host's own, right after opening to LAN). *ctx.next_entity += 1; + let entity_id = *ctx.next_entity as i32; let conn = j.conn; let mut guest = Guest::new(j, entity_id, ctx.spawn, self.config.view_distance); guest.last_action_tick = self.ticks;