Maybe fix left finger resource nodes.

This commit is contained in:
Ottermandias 2024-10-13 13:55:01 +02:00
parent a54e45f9c3
commit 50db83146a
4 changed files with 24 additions and 24 deletions

View file

@ -37,7 +37,7 @@ internal partial record ResolveContext
{ {
var path = IsEquipmentSlot(SlotIndex) var path = IsEquipmentSlot(SlotIndex)
? GamePaths.Equipment.Mdl.Path(Equipment.Set, ResolveModelRaceCode(), Slot.ToSlot()) ? GamePaths.Equipment.Mdl.Path(Equipment.Set, ResolveModelRaceCode(), Slot.ToSlot())
: GamePaths.Accessory.Mdl.Path(Equipment.Set, ResolveModelRaceCode(), Slot.ToSlot()); : GamePaths.Accessory.Mdl.Path(Equipment.Set, ResolveModelRaceCode(), SlotIndex.ToEquipSlot());
return Utf8GamePath.FromString(path, out var gamePath) ? gamePath : Utf8GamePath.Empty; return Utf8GamePath.FromString(path, out var gamePath) ? gamePath : Utf8GamePath.Empty;
} }

View file

@ -340,9 +340,9 @@ internal unsafe partial record ResolveContext(
internal ResourceNode.UiData GuessModelUiData(Utf8GamePath gamePath) internal ResourceNode.UiData GuessModelUiData(Utf8GamePath gamePath)
{ {
var path = gamePath.ToString().Split('/', StringSplitOptions.RemoveEmptyEntries); var path = gamePath.Path.Split((byte)'/');
// Weapons intentionally left out. // Weapons intentionally left out.
var isEquipment = SafeGet(path, 0) == "chara" && SafeGet(path, 1) is "accessory" or "equipment"; var isEquipment = path.Count >= 2 && path[0].Span.SequenceEqual("chara"u8) && (path[1].Span.SequenceEqual("accessory"u8) || path[1].Span.SequenceEqual("equipment"u8));
if (isEquipment) if (isEquipment)
foreach (var item in Global.Identifier.Identify(Equipment.Set, 0, Equipment.Variant, Slot.ToSlot())) foreach (var item in Global.Identifier.Identify(Equipment.Set, 0, Equipment.Variant, Slot.ToSlot()))
{ {