diff --git a/Dalamud/Game/ClientState/ZoneInit.cs b/Dalamud/Game/ClientState/ZoneInit.cs
index 7d451f752..7d6cda90f 100644
--- a/Dalamud/Game/ClientState/ZoneInit.cs
+++ b/Dalamud/Game/ClientState/ZoneInit.cs
@@ -3,6 +3,7 @@ using System.Text;
using Dalamud.Data;
+using Lumina.Excel;
using Lumina.Excel.Sheets;
using Serilog;
@@ -17,7 +18,7 @@ public class ZoneInitEventArgs : EventArgs
///
/// Gets the territory type of the zone being entered.
///
- public TerritoryType TerritoryType { get; private set; }
+ public RowRef TerritoryType { get; private set; }
///
/// Gets the instance number of the zone, used when multiple copies of an area are active.
@@ -27,17 +28,17 @@ public class ZoneInitEventArgs : EventArgs
///
/// Gets the associated content finder condition for the zone, if any.
///
- public ContentFinderCondition ContentFinderCondition { get; private set; }
+ public RowRef ContentFinderCondition { get; private set; }
///
/// Gets the current weather in the zone upon entry.
///
- public Weather Weather { get; private set; }
+ public RowRef Weather { get; private set; }
///
/// Gets the set of active festivals in the zone.
///
- public Festival[] ActiveFestivals { get; private set; } = [];
+ public RowRef[] ActiveFestivals { get; private set; } = [];
///
/// Gets the phases corresponding to the active festivals.
@@ -54,30 +55,23 @@ public class ZoneInitEventArgs : EventArgs
var dataManager = Service.Get();
var eventArgs = new ZoneInitEventArgs();
- try
+ var flags = *(byte*)(packet + 0x12);
+
+ eventArgs.TerritoryType = LuminaUtils.CreateRef(*(ushort*)(packet + 0x02));
+ eventArgs.Instance = flags >= 0 ? (ushort)0 : *(ushort*)(packet + 0x04);
+ eventArgs.ContentFinderCondition = LuminaUtils.CreateRef(*(ushort*)(packet + 0x06));
+ eventArgs.Weather = LuminaUtils.CreateRef(*(byte*)(packet + 0x10));
+
+ const int NumFestivals = 8;
+ eventArgs.ActiveFestivals = new RowRef[NumFestivals];
+ eventArgs.ActiveFestivalPhases = new ushort[NumFestivals];
+
+ // There are also 4 festival ids and phases for PlayerState at +0x3E and +0x46 respectively,
+ // but it's unclear why they exist as separate entries and why they would be different.
+ for (var i = 0; i < NumFestivals; i++)
{
- var flags = *(byte*)(packet + 0x12);
-
- eventArgs.TerritoryType = dataManager.GetExcelSheet().GetRow(*(ushort*)(packet + 0x02));
- eventArgs.Instance = flags >= 0 ? (ushort)0 : *(ushort*)(packet + 0x04);
- eventArgs.ContentFinderCondition = dataManager.GetExcelSheet().GetRow(*(ushort*)(packet + 0x06));
- eventArgs.Weather = dataManager.GetExcelSheet().GetRow(*(byte*)(packet + 0x10));
-
- const int NumFestivals = 8;
- eventArgs.ActiveFestivals = new Festival[NumFestivals];
- eventArgs.ActiveFestivalPhases = new ushort[NumFestivals];
-
- // There are also 4 festival ids and phases for PlayerState at +0x3E and +0x46 respectively,
- // but it's unclear why they exist as separate entries and why they would be different.
- for (var i = 0; i < NumFestivals; i++)
- {
- eventArgs.ActiveFestivals[i] = dataManager.GetExcelSheet().GetRow(*(ushort*)(packet + 0x26 + (i * 2)));
- eventArgs.ActiveFestivalPhases[i] = *(ushort*)(packet + 0x36 + (i * 2));
- }
- }
- catch (Exception ex)
- {
- Log.Error(ex, "Failed to read ZoneInit packet");
+ eventArgs.ActiveFestivals[i] = LuminaUtils.CreateRef(*(ushort*)(packet + 0x26 + (i * 2)));
+ eventArgs.ActiveFestivalPhases[i] = *(ushort*)(packet + 0x36 + (i * 2));
}
return eventArgs;