mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Remove MateriaSlotCount check (#2223)
This commit is contained in:
parent
541c073c32
commit
0e87856bd2
1 changed files with 6 additions and 16 deletions
|
|
@ -120,15 +120,10 @@ public unsafe struct GameInventoryItem : IEquatable<GameInventoryItem>
|
||||||
if (ItemUtil.IsEventItem(baseItemId) || this.IsMateriaUsedForDate)
|
if (ItemUtil.IsEventItem(baseItemId) || this.IsMateriaUsedForDate)
|
||||||
return [];
|
return [];
|
||||||
|
|
||||||
var dataManager = Service<DataManager>.Get();
|
Span<ushort> materiaIds = new ushort[this.InternalItem.Materia.Length];
|
||||||
|
var materiaRowCount = Service<DataManager>.Get().GetExcelSheet<Materia>().Count;
|
||||||
|
|
||||||
if (!dataManager.GetExcelSheet<Item>().TryGetRow(baseItemId, out var item) || item.MateriaSlotCount == 0)
|
for (byte i = 0; i < this.InternalItem.Materia.Length; i++)
|
||||||
return [];
|
|
||||||
|
|
||||||
Span<ushort> materiaIds = new ushort[item.MateriaSlotCount];
|
|
||||||
var materiaRowCount = dataManager.GetExcelSheet<Materia>().Count;
|
|
||||||
|
|
||||||
for (byte i = 0; i < item.MateriaSlotCount; i++)
|
|
||||||
{
|
{
|
||||||
var materiaId = this.InternalItem.GetMateriaId(i);
|
var materiaId = this.InternalItem.GetMateriaId(i);
|
||||||
if (materiaId < materiaRowCount)
|
if (materiaId < materiaRowCount)
|
||||||
|
|
@ -151,15 +146,10 @@ public unsafe struct GameInventoryItem : IEquatable<GameInventoryItem>
|
||||||
if (ItemUtil.IsEventItem(baseItemId) || this.IsMateriaUsedForDate)
|
if (ItemUtil.IsEventItem(baseItemId) || this.IsMateriaUsedForDate)
|
||||||
return [];
|
return [];
|
||||||
|
|
||||||
var dataManager = Service<DataManager>.Get();
|
Span<byte> materiaGrades = new byte[this.InternalItem.MateriaGrades.Length];
|
||||||
|
var materiaGradeRowCount = Service<DataManager>.Get().GetExcelSheet<MateriaGrade>().Count;
|
||||||
|
|
||||||
if (!dataManager.GetExcelSheet<Item>().TryGetRow(baseItemId, out var item) || item.MateriaSlotCount == 0)
|
for (byte i = 0; i < this.InternalItem.MateriaGrades.Length; i++)
|
||||||
return [];
|
|
||||||
|
|
||||||
Span<byte> materiaGrades = new byte[item.MateriaSlotCount];
|
|
||||||
var materiaGradeRowCount = dataManager.GetExcelSheet<MateriaGrade>().Count;
|
|
||||||
|
|
||||||
for (byte i = 0; i < item.MateriaSlotCount; i++)
|
|
||||||
{
|
{
|
||||||
var materiaGrade = this.InternalItem.GetMateriaGrade(i);
|
var materiaGrade = this.InternalItem.GetMateriaGrade(i);
|
||||||
if (materiaGrade < materiaGradeRowCount)
|
if (materiaGrade < materiaGradeRowCount)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue