From f1d9757077a3f837d5a14780655d2df088f0133a Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Thu, 21 Jul 2022 11:57:18 +0200 Subject: [PATCH] Redraw mounts when redrawing actors. --- Penumbra/Interop/ObjectReloader.cs | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/Penumbra/Interop/ObjectReloader.cs b/Penumbra/Interop/ObjectReloader.cs index 0fcab13e..a04801b9 100644 --- a/Penumbra/Interop/ObjectReloader.cs +++ b/Penumbra/Interop/ObjectReloader.cs @@ -2,6 +2,8 @@ using System; using System.Collections.Generic; using System.Linq; using Dalamud.Game.ClientState.Conditions; +using Dalamud.Game.ClientState.Objects.Enums; +using Dalamud.Game.ClientState.Objects.SubKinds; using Dalamud.Game.ClientState.Objects.Types; using Penumbra.Api; using Penumbra.GameData.Enums; @@ -129,10 +131,20 @@ public sealed unsafe partial class ObjectReloader : IDisposable *ActorDrawState( actor! ) |= DrawState.Invisibility; - if( IsGPoseActor( tableIndex ) ) + var gPose = IsGPoseActor( tableIndex ); + if( gPose ) { DisableDraw( actor! ); } + + if( actor is PlayerCharacter && Dalamud.Objects[ tableIndex + 1 ] is { ObjectKind: ObjectKind.MountType } mount ) + { + *ActorDrawState( mount ) |= DrawState.Invisibility; + if( gPose ) + { + DisableDraw( mount ); + } + } } private void WriteVisible( GameObject? actor ) @@ -143,11 +155,22 @@ public sealed unsafe partial class ObjectReloader : IDisposable } *ActorDrawState( actor! ) &= ~DrawState.Invisibility; - if( IsGPoseActor( tableIndex ) ) + + var gPose = IsGPoseActor( tableIndex ); + if( gPose ) { EnableDraw( actor! ); } + if( actor is PlayerCharacter && Dalamud.Objects[ tableIndex + 1 ] is { ObjectKind: ObjectKind.MountType } mount ) + { + *ActorDrawState( mount ) &= ~DrawState.Invisibility; + if( gPose ) + { + EnableDraw( mount ); + } + } + GameObjectRedrawn?.Invoke( actor!.Address, tableIndex ); }