From ef4ca57a6c3f35d1bddc6a70952f478058fbc6b5 Mon Sep 17 00:00:00 2001 From: Thomas Hallock Date: Wed, 22 Oct 2025 10:48:26 -0500 Subject: [PATCH] fix(complement-race): actually filter by isActive instead of just id MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous fix attempted to filter by firstActivePlayer.id but was still getting the first player with ANY id, not the first ACTIVE player. The root cause was line 104 filtering by `p.id` (whether player has an ID) instead of `p.isActive` (whether player is actually active). Changes: - Change filter from `(p) => p.id` to `(p) => p.isActive` - Now correctly identifies the first active player - Train shows only that player's passengers This properly fixes the issue where inactive/disconnected players' passengers were being displayed in the train cars. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../complement-race/components/RaceTrack/SteamTrainJourney.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/app/arcade/complement-race/components/RaceTrack/SteamTrainJourney.tsx b/apps/web/src/app/arcade/complement-race/components/RaceTrack/SteamTrainJourney.tsx index 3c49684e..4fde2a94 100644 --- a/apps/web/src/app/arcade/complement-race/components/RaceTrack/SteamTrainJourney.tsx +++ b/apps/web/src/app/arcade/complement-race/components/RaceTrack/SteamTrainJourney.tsx @@ -101,7 +101,7 @@ export function SteamTrainJourney({ const { profile: _profile } = useUserProfile() // Get the first active player's emoji - const activePlayers = Array.from(players.values()).filter((p) => p.id) + const activePlayers = Array.from(players.values()).filter((p) => p.isActive) const firstActivePlayer = activePlayers[0] const playerEmoji = firstActivePlayer?.emoji ?? '👤'