From 223cc0c883faecddcee3e8d126ee6592e8e4a6da Mon Sep 17 00:00:00 2001 From: Slendy Date: Wed, 8 Mar 2023 15:26:21 -0600 Subject: [PATCH] Add default values for dive in slot --- .../Types/Matchmaking/MatchCommands/FindBestRoom.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ProjectLighthouse/Types/Matchmaking/MatchCommands/FindBestRoom.cs b/ProjectLighthouse/Types/Matchmaking/MatchCommands/FindBestRoom.cs index ffa1d231..9b7e98f7 100644 --- a/ProjectLighthouse/Types/Matchmaking/MatchCommands/FindBestRoom.cs +++ b/ProjectLighthouse/Types/Matchmaking/MatchCommands/FindBestRoom.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; +using System.Linq; using LBPUnion.ProjectLighthouse.Types.Levels; using LBPUnion.ProjectLighthouse.Types.Matchmaking.Rooms; @@ -24,13 +24,10 @@ public class FindBestRoom : IMatchCommand public List Reservations { get; set; } public List> Slots { get; set; } - [JsonIgnore] - public IEnumerable FirstSlot => this.Slots[0]; - public RoomSlot RoomSlot => new() { - SlotType = (SlotType)this.Slots[0][0], - SlotId = this.Slots[0][1], + SlotType = (SlotType)(this.Slots.ElementAtOrDefault(0)?.ElementAtOrDefault(0) ?? (int)SlotType.Pod), + SlotId = this.Slots.ElementAtOrDefault(0)?.ElementAtOrDefault(1) ?? 0, }; } \ No newline at end of file