This commit is contained in:
Mister_Nebula 2022-05-13 22:46:20 +01:00
parent 19c9ce0457
commit 2394ee90b9

View File

@ -46,7 +46,10 @@ public class ConversationManager : WorldObjectManager
}
public uint GetPlayerTalkingToTree(CharacterDialogueTree tree)
=> QSBPlayerManager.PlayerList.FirstOrDefault(x => x.CurrentCharacterDialogueTree?.AttachedObject == tree).PlayerId;
{
var player = QSBPlayerManager.PlayerList.FirstOrDefault(x => x.CurrentCharacterDialogueTree?.AttachedObject == tree);
return player != null ? player.PlayerId : uint.MaxValue;
}
public void SendPlayerOption(string text)
=> new ConversationMessage(ConversationType.Player, (int)QSBPlayerManager.LocalPlayerId, text).Send();