From c0077b1e260a34e3e2f36ab8d4bd1b08aa9623d2 Mon Sep 17 00:00:00 2001 From: KazWolfe Date: Tue, 27 Jan 2026 09:30:34 -0800 Subject: [PATCH] Revert "Use RowRef in ZoneInitEventArgs (#2540)" (#2597) This reverts commit 5da79a7dbaa88a3c5695ec54b5882e19f393a5dc. --- Dalamud/Game/ClientState/ZoneInit.cs | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/Dalamud/Game/ClientState/ZoneInit.cs b/Dalamud/Game/ClientState/ZoneInit.cs index 7d6cda90f..7eb4576aa 100644 --- a/Dalamud/Game/ClientState/ZoneInit.cs +++ b/Dalamud/Game/ClientState/ZoneInit.cs @@ -3,11 +3,8 @@ using System.Text; using Dalamud.Data; -using Lumina.Excel; using Lumina.Excel.Sheets; -using Serilog; - namespace Dalamud.Game.ClientState; /// @@ -18,7 +15,7 @@ public class ZoneInitEventArgs : EventArgs /// /// Gets the territory type of the zone being entered. /// - public RowRef TerritoryType { get; private set; } + public TerritoryType TerritoryType { get; private set; } /// /// Gets the instance number of the zone, used when multiple copies of an area are active. @@ -28,17 +25,17 @@ public class ZoneInitEventArgs : EventArgs /// /// Gets the associated content finder condition for the zone, if any. /// - public RowRef ContentFinderCondition { get; private set; } + public ContentFinderCondition ContentFinderCondition { get; private set; } /// /// Gets the current weather in the zone upon entry. /// - public RowRef Weather { get; private set; } + public Weather Weather { get; private set; } /// /// Gets the set of active festivals in the zone. /// - public RowRef[] ActiveFestivals { get; private set; } = []; + public Festival[] ActiveFestivals { get; private set; } = []; /// /// Gets the phases corresponding to the active festivals. @@ -57,20 +54,20 @@ public class ZoneInitEventArgs : EventArgs var flags = *(byte*)(packet + 0x12); - eventArgs.TerritoryType = LuminaUtils.CreateRef(*(ushort*)(packet + 0x02)); + eventArgs.TerritoryType = dataManager.GetExcelSheet().GetRow(*(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)); + eventArgs.ContentFinderCondition = dataManager.GetExcelSheet().GetRow(*(ushort*)(packet + 0x06)); + eventArgs.Weather = dataManager.GetExcelSheet().GetRow(*(byte*)(packet + 0x10)); const int NumFestivals = 8; - eventArgs.ActiveFestivals = new RowRef[NumFestivals]; + 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] = LuminaUtils.CreateRef(*(ushort*)(packet + 0x26 + (i * 2))); + eventArgs.ActiveFestivals[i] = dataManager.GetExcelSheet().GetRow(*(ushort*)(packet + 0x26 + (i * 2))); eventArgs.ActiveFestivalPhases[i] = *(ushort*)(packet + 0x36 + (i * 2)); }