Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions EXILED/Exiled.API/Features/Room.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,16 @@ public class Room : MonoBehaviour, IWorldSpace
/// <summary>
/// Gets a <see cref="IReadOnlyList{T}"/> of <see cref="Room"/> around the <see cref="Room"/>.
/// </summary>
public IReadOnlyList<Room> NearestRooms { get; private set; }
public IReadOnlyList<Room> NearestRooms
{
get
{
if (NearestRoomsValue.Count == 0 && Identifier.ConnectedRooms.Count > 0)
NearestRoomsValue.AddRange(Identifier.ConnectedRooms.Select(Get));

return NearestRoomsValue;
}
}

/// <summary>
/// Gets a <see cref="IEnumerable{T}"/> of <see cref="Pickup"/> in the <see cref="Room"/>.
Expand Down Expand Up @@ -438,7 +447,6 @@ internal void InternalCreate()

Windows = WindowsValue.AsReadOnly();
Doors = DoorsValue.AsReadOnly();
NearestRooms = NearestRoomsValue.AsReadOnly();
Speakers = SpeakersValue.AsReadOnly();
Cameras = CamerasValue.AsReadOnly();
}
Expand Down
1 change: 0 additions & 1 deletion EXILED/Exiled.Events/Patches/Generic/DoorList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ private static void InitDoor(DoorVariant doorVariant)
foreach (Room room in rooms)
{
room.DoorsValue.Add(door);
room.NearestRoomsValue.AddRange(rooms.Except(new List<Room>() { room }));
}

if (door.Is(out CheckpointDoor checkpoint))
Expand Down
Loading