Fix issues with meta toggles.

This commit is contained in:
Ottermandias 2023-12-02 21:47:14 +01:00
parent dd289e6bd7
commit e317b3683f
2 changed files with 4 additions and 3 deletions

View file

@ -49,9 +49,9 @@ public unsafe class MetaService : IDisposable
if (!actor.IsCharacter) if (!actor.IsCharacter)
return; return;
// The function seems to not do anything if the head is 0, sometimes? // The function seems to not do anything if the head is 0, but also breaks for carbuncles turned human, sometimes?
var old = actor.AsCharacter->DrawData.Head.Id; var old = actor.AsCharacter->DrawData.Head.Id;
if (old == 0) if (old == 0 && actor.AsCharacter->CharacterData.ModelCharaId == 0)
actor.AsCharacter->DrawData.Head.Id = 1; actor.AsCharacter->DrawData.Head.Id = 1;
_hideHatGearHook.Original(&actor.AsCharacter->DrawData, 0, (byte)(value ? 0 : 1)); _hideHatGearHook.Original(&actor.AsCharacter->DrawData, 0, (byte)(value ? 0 : 1));
actor.AsCharacter->DrawData.Head.Id = old; actor.AsCharacter->DrawData.Head.Id = old;

View file

@ -68,7 +68,8 @@ public unsafe class WeaponService : IDisposable
if (equipSlot is not EquipSlot.Unknown) if (equipSlot is not EquipSlot.Unknown)
_event.Invoke(actor, equipSlot, ref tmpWeapon); _event.Invoke(actor, equipSlot, ref tmpWeapon);
// Sage hack for weapons appearing in animations? // Sage hack for weapons appearing in animations?
else if (weaponValue == actor.GetMainhand().Value) // Check for weapon value 0 for certain cases (e.g. carbuncles transforming to humans) because that breaks some stuff (weapon hiding?) otherwise.
else if (weaponValue == actor.GetMainhand().Value && weaponValue != 0)
_event.Invoke(actor, EquipSlot.MainHand, ref tmpWeapon); _event.Invoke(actor, EquipSlot.MainHand, ref tmpWeapon);
_loadWeaponHook.Original(drawData, slot, weapon.Value, redrawOnEquality, unk2, skipGameObject, unk4); _loadWeaponHook.Original(drawData, slot, weapon.Value, redrawOnEquality, unk2, skipGameObject, unk4);