Fix some issues with customization IDs and supported counts.

This commit is contained in:
Ottermandias 2025-05-19 17:15:29 +02:00
parent 47b5895404
commit 68b68d6ce7
4 changed files with 16 additions and 5 deletions

View file

@ -5,6 +5,7 @@ using Penumbra.GameData.Data;
using Penumbra.GameData.Enums;
using Penumbra.GameData.Structs;
using Penumbra.Interop.Structs;
using Penumbra.Meta.Files;
namespace Penumbra.Meta.Manipulations;
@ -98,6 +99,12 @@ public readonly record struct ShpIdentifier(HumanSlot Slot, PrimaryId? Id, Shape
if (Slot is HumanSlot.Unknown && Id is not null)
return false;
if (Slot.ToSpecificEnum() is BodySlot && Id is { Id: > byte.MaxValue })
return false;
if (Id is { Id: > ExpandedEqpGmpBase.Count - 1 })
return false;
if (!ValidateCustomShapeString(Shape))
return false;

View file

@ -70,7 +70,7 @@ public class ShapeManager : IRequiredService, IDisposable
if (model is null || model->ModelResourceHandle is null)
continue;
_ids[(int)modelIndex] = human.GetArmorChanged(modelIndex).Set;
_ids[(int)modelIndex] = human.GetModelId(modelIndex);
ref var shapes = ref model->ModelResourceHandle->Shapes;
foreach (var (shape, index) in shapes.Where(kvp => ShpIdentifier.ValidateCustomShapeString(kvp.Key.Value)))