Fix crash on mannequins with resource logging on, fix problem with temp collections not keeping count.

This commit is contained in:
Ottermandias 2023-02-03 21:23:38 +01:00
parent 60f54fa047
commit e34aca68aa
9 changed files with 42 additions and 18 deletions

View file

@ -165,14 +165,15 @@ public sealed partial class ActorManager : IDisposable
public readonly ActorManagerData Data;
public ActorManager(DalamudPluginInterface pluginInterface, ObjectTable objects, ClientState state, DataManager gameData, GameGui gameGui,
public ActorManager(DalamudPluginInterface pluginInterface, ObjectTable objects, ClientState state, Dalamud.Game.Framework framework, DataManager gameData, GameGui gameGui,
Func<ushort, short> toParentIdx)
: this(pluginInterface, objects, state, gameData, gameGui, gameData.Language, toParentIdx)
: this(pluginInterface, objects, state, framework, gameData, gameGui, gameData.Language, toParentIdx)
{ }
public ActorManager(DalamudPluginInterface pluginInterface, ObjectTable objects, ClientState state, DataManager gameData, GameGui gameGui,
public ActorManager(DalamudPluginInterface pluginInterface, ObjectTable objects, ClientState state, Dalamud.Game.Framework framework, DataManager gameData, GameGui gameGui,
ClientLanguage language, Func<ushort, short> toParentIdx)
{
_framework = framework;
_objects = objects;
_gameGui = gameGui;
_clientState = state;
@ -340,9 +341,10 @@ public sealed partial class ActorManager : IDisposable
~ActorManager()
=> Dispose();
private readonly ObjectTable _objects;
private readonly ClientState _clientState;
private readonly GameGui _gameGui;
private readonly Dalamud.Game.Framework _framework;
private readonly ObjectTable _objects;
private readonly ClientState _clientState;
private readonly GameGui _gameGui;
private readonly Func<ushort, short> _toParentIdx;

View file

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using Dalamud.Game.ClientState.Objects.Enums;
using Dalamud.Game.ClientState.Objects.Types;
using Dalamud.Logging;
using Newtonsoft.Json.Linq;
using Penumbra.String;
using Character = FFXIVClientStructs.FFXIV.Client.Game.Character.Character;
@ -313,8 +314,8 @@ public partial class ActorManager
static ByteString Get(byte* ptr)
=> ptr == null ? ByteString.Empty : new ByteString(ptr);
var actualName = Get(actor->GetName());
var retainerName = Get(actor->Name);
var actualName = _framework.IsInFrameworkUpdateThread ? Get(actor->GetName()) : ByteString.Empty;
if (!actualName.Equals(retainerName))
{
var ident = check
@ -338,7 +339,7 @@ public partial class ActorManager
if (owner == null)
return ActorIdentifier.Invalid;
var dataId = GetCompanionId(actor, (Character*) owner);
var dataId = GetCompanionId(actor, (Character*)owner);
var name = new ByteString(owner->Name);
var homeWorld = ((Character*)owner)->HomeWorld;
return check
@ -553,10 +554,10 @@ public partial class ActorManager
{
return index switch
{
ushort.MaxValue => true,
< 200 => index % 2 == 0,
ushort.MaxValue => true,
< 200 => index % 2 == 0,
> (ushort)ScreenActor.Card8 => index < 426,
_ => false,
_ => false,
};
}