From e447fff38f72b99da2c25d7b4f553f1ba3645eb5 Mon Sep 17 00:00:00 2001 From: jvyden Date: Tue, 5 Apr 2022 17:34:59 -0400 Subject: [PATCH] Don't attempt to dive into the current room the player is in --- ProjectLighthouse/Helpers/RoomHelper.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ProjectLighthouse/Helpers/RoomHelper.cs b/ProjectLighthouse/Helpers/RoomHelper.cs index cd549b30..03a52a82 100644 --- a/ProjectLighthouse/Helpers/RoomHelper.cs +++ b/ProjectLighthouse/Helpers/RoomHelper.cs @@ -70,6 +70,12 @@ public class RoomHelper rooms = rooms.Where(r => r.Slot.SlotType == slot.SlotType && r.Slot.SlotId == slot.SlotId).ToList(); } + // Don't attempt to dive into the current room the player is in. + if (user != null) + { + rooms = rooms.Where(r => !r.Players.Contains(user)).ToList(); + } + foreach (Room room in rooms) // Look for rooms looking for players before moving on to rooms that are idle. {