From dde4ba9b3b88b3e5e120e0349b62a01b604b5481 Mon Sep 17 00:00:00 2001 From: Anna Date: Tue, 8 Dec 2020 22:26:14 -0500 Subject: [PATCH] fix: work around lumina bug --- Globetrotter/TreasureMaps.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Globetrotter/TreasureMaps.cs b/Globetrotter/TreasureMaps.cs index f79a9cd..83e7504 100644 --- a/Globetrotter/TreasureMaps.cs +++ b/Globetrotter/TreasureMaps.cs @@ -1,5 +1,4 @@ using Dalamud.Game.Chat.SeStringHandling.Payloads; -using Dalamud.Game.Internal.Network; using Dalamud.Hooking; using Dalamud.Plugin; using Lumina.Excel.GeneratedSheets; @@ -26,7 +25,13 @@ namespace Globetrotter { continue; } - EventItem opened = rank.KeyItemName.Value; + EventItem opened; + // FIXME: remove this try/catch when lumina is fixed + try { + opened = rank.KeyItemName.Value; + } catch (NullReferenceException) { + opened = null; + } if (opened == null) { continue; } @@ -131,7 +136,7 @@ namespace Globetrotter { } public static TreasureMapPacket ParsePacket(IntPtr dataPtr) { - uint category = (uint)Marshal.ReadByte(dataPtr); + uint category = Marshal.ReadByte(dataPtr); if (category != TREASURE_MAPS) { return null; }