mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-22 16:39:19 +01:00
Add SearchByEntityId (#1935)
This commit is contained in:
parent
f5ab8d5e98
commit
d966e5338a
2 changed files with 24 additions and 0 deletions
|
|
@ -98,6 +98,23 @@ internal sealed partial class ObjectTable : IServiceType, IObjectTable
|
|||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IGameObject? SearchByEntityId(uint entityId)
|
||||
{
|
||||
_ = this.WarnMultithreadedUsage();
|
||||
|
||||
if (entityId is 0 or 0xE0000000)
|
||||
return null;
|
||||
|
||||
foreach (var e in this.cachedObjectTable)
|
||||
{
|
||||
if (e.Update() is { } o && o.EntityId == entityId)
|
||||
return o;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public unsafe nint GetObjectAddress(int index)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue