Fix chat command not working.

This commit is contained in:
Ottermandias 2022-11-22 16:57:40 +01:00
parent 776d993589
commit a64273bd73

View file

@ -333,6 +333,7 @@ public class Penumbra : IDalamudPlugin
}
string? characterName = null;
var identifier = ActorIdentifier.Invalid;
if( type is CollectionType.Individual )
{
var split = collectionName.Split( '|', 2, StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries );
@ -344,6 +345,13 @@ public class Penumbra : IDalamudPlugin
collectionName = split[ 0 ];
characterName = split[ 1 ];
identifier = Actors.CreatePlayer( ByteString.FromStringUnsafe( characterName, false ), ushort.MaxValue );
if( !identifier.IsValid )
{
Dalamud.Chat.Print( $"{characterName} is not a valid character name." );
return false;
}
}
collectionName = collectionName.ToLowerInvariant();
@ -356,13 +364,6 @@ public class Penumbra : IDalamudPlugin
return false;
}
var identifier = Actors.CreatePlayer( ByteString.FromStringUnsafe( characterName, false ), ushort.MaxValue );
if( !identifier.IsValid )
{
Dalamud.Chat.Print( $"{characterName} is not a valid character name." );
return false;
}
var oldCollection = CollectionManager.ByType( type, identifier );
if( collection == oldCollection )
{