This commit is contained in:
Ottermandias 2023-12-21 17:05:24 +01:00
parent 3071599d94
commit 648b3d4515
5 changed files with 18 additions and 18 deletions

View file

@ -121,9 +121,9 @@ public class DesignBase64Migration
data.SetStain(slot, mdl.Stain);
}
var main = cur[0].X.Id == 0
var main = cur[0].Skeleton.Id == 0
? items.DefaultSword
: items.Identify(EquipSlot.MainHand, cur[0].X, cur[0].Y, cur[0].Variant);
: items.Identify(EquipSlot.MainHand, cur[0].Skeleton, cur[0].Weapon, cur[0].Variant);
if (!main.Valid)
{
Glamourer.Log.Warning("Base64 string invalid, weapon could not be identified.");
@ -138,7 +138,7 @@ public class DesignBase64Migration
if (main.PrimaryId.Id is > 1600 and < 1651 && cur[1].Variant == 0)
{
off = items.Identify(EquipSlot.OffHand, (PrimaryId)(main.PrimaryId.Id + 50), main.SecondaryId, main.Variant, main.Type);
var gauntlet = items.Identify(EquipSlot.Hands, cur[1].X, (Variant)cur[1].Y.Id);
var gauntlet = items.Identify(EquipSlot.Hands, cur[1].Skeleton, (Variant)cur[1].Weapon.Id);
if (gauntlet.Valid)
{
data.SetItem(EquipSlot.Hands, gauntlet);
@ -147,9 +147,9 @@ public class DesignBase64Migration
}
else
{
off = cur[0].X.Id == 0
off = cur[0].Skeleton.Id == 0
? ItemManager.NothingItem(FullEquipType.Shield)
: items.Identify(EquipSlot.OffHand, cur[1].X, cur[1].Y, cur[1].Variant, main.Type);
: items.Identify(EquipSlot.OffHand, cur[1].Skeleton, cur[1].Weapon, cur[1].Variant, main.Type);
}
if (main.Type.ValidOffhand() != FullEquipType.Unknown && !off.Valid)

View file

@ -165,7 +165,7 @@ public class DesignConverter(ItemManager _items, DesignManager _designs, Customi
yield return (slot, item, armor.Stain);
}
var mh = _items.Identify(EquipSlot.MainHand, mainhand.X, mainhand.Y, mainhand.Variant, FullEquipType.Unknown);
var mh = _items.Identify(EquipSlot.MainHand, mainhand.Skeleton, mainhand.Weapon, mainhand.Variant, FullEquipType.Unknown);
if (!mh.Valid)
{
Glamourer.Log.Warning($"Appearance data {mainhand} for mainhand weapon invalid, item could not be identified.");
@ -174,7 +174,7 @@ public class DesignConverter(ItemManager _items, DesignManager _designs, Customi
yield return (EquipSlot.MainHand, mh, mainhand.Stain);
var oh = _items.Identify(EquipSlot.OffHand, offhand.X, offhand.Y, offhand.Variant, mh.Type);
var oh = _items.Identify(EquipSlot.OffHand, offhand.Skeleton, offhand.Weapon, offhand.Variant, mh.Type);
if (!oh.Valid)
{
Glamourer.Log.Warning($"Appearance data {offhand} for offhand weapon invalid, item could not be identified.");

View file

@ -177,7 +177,7 @@ public class PenumbraChangedItemTooltip : IDisposable
private bool CanApplyWeapon(EquipSlot slot, EquipItem item)
{
var main = _objects.Player.GetMainhand();
var mainItem = _items.Identify(slot, main.X, main.Y, main.Variant);
var mainItem = _items.Identify(slot, main.Skeleton, main.Weapon, main.Variant);
if (slot == EquipSlot.MainHand)
return item.Type == mainItem.Type;

View file

@ -76,7 +76,7 @@ public unsafe class WeaponService : IDisposable
if (tmpWeapon.Value != weapon.Value)
{
if (tmpWeapon.X.Id == 0)
if (tmpWeapon.Skeleton.Id == 0)
tmpWeapon.Stain = 0;
_loadWeaponHook.Original(drawData, slot, tmpWeapon.Value, 1, unk2, 1, unk4);
}
@ -119,7 +119,7 @@ public unsafe class WeaponService : IDisposable
var mdl = character.Model;
var (_, _, mh, oh) = mdl.GetWeapons(character);
var value = slot == EquipSlot.OffHand ? oh : mh;
var weapon = value.With(value.X.Id == 0 ? 0 : stain);
var weapon = value.With(value.Skeleton.Id == 0 ? 0 : stain);
LoadWeapon(character, slot, weapon);
}
}

View file

@ -272,7 +272,7 @@ public class StateListener : IDisposable
return;
// Fist weapon gauntlet hack.
if (slot is EquipSlot.OffHand && weapon.Value.Variant == 0 && weapon.Value.Y.Id != 0 && _lastFistOffhand.Y.Id != 0)
if (slot is EquipSlot.OffHand && weapon.Value.Variant == 0 && weapon.Value.Weapon.Id != 0 && _lastFistOffhand.Weapon.Id != 0)
weapon.Value = _lastFistOffhand;
if (!actor.Identifier(_actors, out var identifier)
@ -308,13 +308,13 @@ public class StateListener : IDisposable
var newWeapon = state.ModelData.Weapon(slot);
if (baseType is FullEquipType.Unknown || baseType == state.ModelData.Item(slot).Type || _gPose.InGPose && actor.IsGPoseOrCutscene)
actorWeapon = newWeapon;
else if (actorWeapon.X.Id != 0)
else if (actorWeapon.Skeleton.Id != 0)
actorWeapon = actorWeapon.With(newWeapon.Stain);
}
// Fist Weapon Offhand hack.
if (slot is EquipSlot.MainHand && weapon.Value.X.Id is > 1600 and < 1651)
_lastFistOffhand = new CharacterWeapon((PrimaryId)(weapon.Value.X.Id + 50), weapon.Value.Y, weapon.Value.Variant,
if (slot is EquipSlot.MainHand && weapon.Value.Skeleton.Id is > 1600 and < 1651)
_lastFistOffhand = new CharacterWeapon((PrimaryId)(weapon.Value.Skeleton.Id + 50), weapon.Value.Weapon, weapon.Value.Variant,
weapon.Value.Stain);
_funModule.ApplyFun(actor, ref weapon.Value, slot);
@ -329,7 +329,7 @@ public class StateListener : IDisposable
return false;
var offhand = actor.GetOffhand();
return offhand.Variant == 0 && offhand.Y.Id != 0 && armor.Set.Id == offhand.Y.Id;
return offhand.Variant == 0 && offhand.Weapon.Id != 0 && armor.Set.Id == offhand.Weapon.Id;
}
var actorArmor = actor.GetArmor(slot);
@ -474,7 +474,7 @@ public class StateListener : IDisposable
var change = UpdateState.NoChange;
// Fist weapon bug hack
if (slot is EquipSlot.OffHand && weapon.Value == 0 && actor.GetMainhand().X.Id is > 1600 and < 1651)
if (slot is EquipSlot.OffHand && weapon.Value == 0 && actor.GetMainhand().Skeleton.Id is > 1600 and < 1651)
return UpdateState.NoChange;
if (baseData.Stain != weapon.Stain)
@ -483,9 +483,9 @@ public class StateListener : IDisposable
change = UpdateState.Change;
}
if (baseData.X.Id != weapon.X.Id || baseData.Y.Id != weapon.Y.Id || baseData.Variant != weapon.Variant)
if (baseData.Skeleton.Id != weapon.Skeleton.Id || baseData.Weapon.Id != weapon.Weapon.Id || baseData.Variant != weapon.Variant)
{
var item = _items.Identify(slot, weapon.X, weapon.Y, weapon.Variant,
var item = _items.Identify(slot, weapon.Skeleton, weapon.Weapon, weapon.Variant,
slot is EquipSlot.OffHand ? state.BaseData.Item(EquipSlot.MainHand).Type : FullEquipType.Unknown);
state.BaseData.SetItem(slot, item);
change = UpdateState.Change;