mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Use IndividualCollections in PathResolver.
This commit is contained in:
parent
f8c0702432
commit
6a6eac1c3b
10 changed files with 128 additions and 245 deletions
|
|
@ -2,7 +2,6 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using Dalamud.Game.ClientState.Objects.Enums;
|
||||
using FFXIVClientStructs.FFXIV.Client.Game.Character;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Penumbra.String;
|
||||
|
||||
|
|
@ -38,7 +37,7 @@ public readonly struct ActorIdentifier : IEquatable<ActorIdentifier>
|
|||
IdentifierType.Player => HomeWorld == other.HomeWorld && PlayerName.EqualsCi(other.PlayerName),
|
||||
IdentifierType.Owned => HomeWorld == other.HomeWorld && PlayerName.EqualsCi(other.PlayerName) && Manager.DataIdEquals(this, other),
|
||||
IdentifierType.Special => Special == other.Special,
|
||||
IdentifierType.Npc => Index == other.Index && DataId == other.DataId && Manager.DataIdEquals(this, other),
|
||||
IdentifierType.Npc => Manager.DataIdEquals(this, other) && (Index == other.Index || Index == ushort.MaxValue || other.Index == ushort.MaxValue),
|
||||
_ => false,
|
||||
};
|
||||
}
|
||||
|
|
@ -75,7 +74,7 @@ public readonly struct ActorIdentifier : IEquatable<ActorIdentifier>
|
|||
IdentifierType.Player => HashCode.Combine(IdentifierType.Player, PlayerName, HomeWorld),
|
||||
IdentifierType.Owned => HashCode.Combine(IdentifierType.Owned, Kind, PlayerName, HomeWorld, DataId),
|
||||
IdentifierType.Special => HashCode.Combine(IdentifierType.Special, Special),
|
||||
IdentifierType.Npc => HashCode.Combine(IdentifierType.Npc, Kind, Index, DataId),
|
||||
IdentifierType.Npc => HashCode.Combine(IdentifierType.Npc, Kind, DataId),
|
||||
_ => 0,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Dalamud;
|
||||
|
|
@ -70,7 +69,10 @@ public sealed partial class ActorManager : DataSharer
|
|||
public unsafe ActorIdentifier GetCurrentPlayer()
|
||||
{
|
||||
var address = (Character*)(_objects[0]?.Address ?? IntPtr.Zero);
|
||||
return address == null ? ActorIdentifier.Invalid : CreatePlayer(new ByteString(address->GameObject.Name), address->HomeWorld);
|
||||
return address == null
|
||||
? ActorIdentifier.Invalid
|
||||
: CreateIndividualUnchecked(IdentifierType.Player, new ByteString(address->GameObject.Name), address->HomeWorld,
|
||||
ObjectKind.None, uint.MaxValue);
|
||||
}
|
||||
|
||||
public ActorIdentifier GetInspectPlayer()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue