Redraw mounts when redrawing actors.

This commit is contained in:
Ottermandias 2022-07-21 11:57:18 +02:00
parent 9dee0862cc
commit f1d9757077

View file

@ -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 );
}