mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Merge pull request #59 from ff-meli/player_name_fix
fix discord name handling (and subsequent character lookup) of local player chats in party/alliance
This commit is contained in:
commit
350f9ab3c3
1 changed files with 10 additions and 2 deletions
|
|
@ -189,12 +189,20 @@ namespace Dalamud.DiscordBot {
|
|||
if (playerLink == null) {
|
||||
// chat messages from the local player do not include a player link, and are just the raw name
|
||||
// but we should still track other instances to know if this is ever an issue otherwise
|
||||
if (parsedSender.TextValue != this.dalamud.ClientState.LocalPlayer.Name)
|
||||
|
||||
// Special case 2 - When the local player talks in party/alliance, the name comes through as raw text,
|
||||
// but prefixed by their position number in the party (which for local player may always be 1)
|
||||
if (parsedSender.TextValue.EndsWith(this.dalamud.ClientState.LocalPlayer.Name))
|
||||
{
|
||||
senderName = this.dalamud.ClientState.LocalPlayer.Name;
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Error("playerLink was null. Sender: {0}", BitConverter.ToString(sender.RawData));
|
||||
|
||||
senderName = wasOutgoingTell ? this.dalamud.ClientState.LocalPlayer.Name : parsedSender.TextValue;
|
||||
}
|
||||
|
||||
senderName = wasOutgoingTell ? this.dalamud.ClientState.LocalPlayer.Name : parsedSender.TextValue;
|
||||
senderWorld = this.dalamud.ClientState.LocalPlayer.HomeWorld.Name;
|
||||
} else {
|
||||
playerLink.Resolve();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue