mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-13 12:14:17 +01:00
Fix Player Collection identification.
This commit is contained in:
parent
69703ed97f
commit
2900351b9a
2 changed files with 8 additions and 5 deletions
|
|
@ -172,7 +172,7 @@ public sealed partial class ActorManager : IDisposable
|
||||||
|
|
||||||
public unsafe ActorIdentifier GetCurrentPlayer()
|
public unsafe ActorIdentifier GetCurrentPlayer()
|
||||||
{
|
{
|
||||||
var address = (Character*)(_objects[0]?.Address ?? IntPtr.Zero);
|
var address = (Character*)_objects.GetObjectAddress(0);
|
||||||
return address == null
|
return address == null
|
||||||
? ActorIdentifier.Invalid
|
? ActorIdentifier.Invalid
|
||||||
: CreateIndividualUnchecked(IdentifierType.Player, new ByteString(address->GameObject.Name), address->HomeWorld,
|
: CreateIndividualUnchecked(IdentifierType.Player, new ByteString(address->GameObject.Name), address->HomeWorld,
|
||||||
|
|
|
||||||
|
|
@ -63,14 +63,17 @@ public unsafe partial class PathResolver
|
||||||
// or the default collection if no player exists.
|
// or the default collection if no player exists.
|
||||||
public static ModCollection PlayerCollection()
|
public static ModCollection PlayerCollection()
|
||||||
{
|
{
|
||||||
var player = Penumbra.Actors.GetCurrentPlayer();
|
var gameObject = ( GameObject* )Dalamud.Objects.GetObjectAddress( 0 );
|
||||||
if( !player.IsValid )
|
if( gameObject == null )
|
||||||
{
|
{
|
||||||
return Penumbra.CollectionManager.Default;
|
return Penumbra.CollectionManager.ByType( CollectionType.Yourself )
|
||||||
|
?? Penumbra.CollectionManager.Default;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var player = Penumbra.Actors.GetCurrentPlayer();
|
||||||
return CollectionByIdentifier( player )
|
return CollectionByIdentifier( player )
|
||||||
?? CollectionByAttributes( ( GameObject* )Dalamud.Objects[ 0 ]!.Address )
|
?? CheckYourself( player, gameObject )
|
||||||
|
?? CollectionByAttributes( gameObject )
|
||||||
?? Penumbra.CollectionManager.Default;
|
?? Penumbra.CollectionManager.Default;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue