Use object table index instead of passing ICharacter/Character address. Seems like the dev who decided to shit talk behind my back about this forgot it was them who implemented it that way.

This commit is contained in:
RisaDev
2024-07-29 22:12:49 +03:00
parent f2ea64c398
commit 8fcfe9e94d
4 changed files with 46 additions and 69 deletions

View File

@@ -7,13 +7,8 @@ using Penumbra.GameData.Enums;
using Penumbra.GameData.Interop;
using ObjectManager = CustomizePlus.GameData.Services.ObjectManager;
using DalamudGameObject = Dalamud.Game.ClientState.Objects.Types.IGameObject;
using ECommons.Configuration;
using System;
using CustomizePlus.Configuration.Data;
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
using Penumbra.GameData;
using Penumbra.String;
using Dalamud.Logging;
using FFXIVClientStructs.FFXIV.Client.Game.Object;
namespace CustomizePlus.Game.Services;
@@ -145,6 +140,19 @@ public class GameObjectService
}
}
/// <summary>
/// Find actor in object manager based on its Object ID.
/// </summary>
public Actor? GetActorByObjectIndex(ushort objectIndex)
{
if (objectIndex < 0 || objectIndex >= _objectManager.TotalCount)
return null;
var ptr = _objectManager[(int)objectIndex];
return ptr;
}
public enum SpecialResult
{
PartyBanner,