From f552f9b03fe7310d3aa286010ceb4ac5a7ba02c0 Mon Sep 17 00:00:00 2001 From: Maple Nebel Date: Mon, 11 May 2026 14:52:31 +0200 Subject: [PATCH] add check for if host is in session to reachability check --- rnex-core/src/nex/matchmake.rs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/rnex-core/src/nex/matchmake.rs b/rnex-core/src/nex/matchmake.rs index 70e720d..52b5ad1 100644 --- a/rnex-core/src/nex/matchmake.rs +++ b/rnex-core/src/nex/matchmake.rs @@ -313,15 +313,18 @@ impl ExtendedMatchmakeSession { #[inline] pub fn is_reachable(&self) -> bool { - (if self.session.gathering.flags & PERSISTENT_GATHERING != 0 { - if self.has_active_players() { - true + self.get_active_players() + .iter() + .any(|v| v.pid == self.session.gathering.host_pid) + && (if self.session.gathering.flags & PERSISTENT_GATHERING != 0 { + if self.has_active_players() { + true + } else { + self.session.open_participation + } } else { - self.session.open_participation - } - } else { - self.has_active_players() - }) & self.has_active_players() + self.has_active_players() + }) & self.has_active_players() } #[inline] pub fn is_joinable(&self) -> bool {