mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Fix potential crash in decref.
This commit is contained in:
parent
4f2a14c9ee
commit
96e6ff0fbf
2 changed files with 14 additions and 6 deletions
|
|
@ -48,16 +48,16 @@ internal sealed class EquipmentIdentificationList : KeyList<PseudoEquipItem>
|
|||
|
||||
private static IEnumerable<PseudoEquipItem> CreateEquipmentList(ItemData data)
|
||||
{
|
||||
var items = gameData.GetExcelSheet<Item>(language)!;
|
||||
return items.Where(i => ((EquipSlot)i.EquipSlotCategory.Row).IsEquipmentPiece())
|
||||
.Select(i => (PseudoEquipItem)EquipItem.FromArmor(i))
|
||||
return data.Where(kvp => kvp.Key.IsEquipment() || kvp.Key.IsAccessory())
|
||||
.SelectMany(kvp => kvp.Value)
|
||||
.Select(i => (PseudoEquipItem)i)
|
||||
.Concat(CustomList);
|
||||
}
|
||||
|
||||
private static IEnumerable<PseudoEquipItem> CustomList
|
||||
=> new[]
|
||||
{
|
||||
(PseudoEquipItem)EquipItem.FromIds(0, 0, 8100, 0, 1, FullEquipType.Body, "Reaper Shroud"),
|
||||
(PseudoEquipItem)EquipItem.FromIds(0, 0, 8100, 0, 1, FullEquipType.Body, "Reaper Shroud"),
|
||||
(PseudoEquipItem)EquipItem.FromIds(0, 0, 9041, 0, 1, FullEquipType.Head, "Cid's Bandana (9041)"),
|
||||
(PseudoEquipItem)EquipItem.FromIds(0, 0, 9041, 0, 1, FullEquipType.Body, "Cid's Body (9041)"),
|
||||
(PseudoEquipItem)EquipItem.FromIds(0, 0, 9903, 0, 1, FullEquipType.Head, "Smallclothes (NPC, 9903)"),
|
||||
|
|
|
|||
|
|
@ -212,8 +212,16 @@ public unsafe class ResourceLoader : IDisposable
|
|||
if (handle->RefCount != 0)
|
||||
return;
|
||||
|
||||
Penumbra.Log.Error(
|
||||
$"[ResourceLoader] Caught decrease of Reference Counter for {handle->FileName()} at 0x{(ulong)handle} below 0.");
|
||||
try
|
||||
{
|
||||
Penumbra.Log.Error(
|
||||
$"[ResourceLoader] Caught decrease of Reference Counter for {handle->FileName()} at 0x{(ulong)handle} below 0.");
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
|
||||
returnValue = 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue