From 14d9f1d8bbc817ff2417372cffc0bee7b8eefdba Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 3 Dec 2018 18:13:10 +0900 Subject: [PATCH] Fix hard crash due to out-of-order chat sequencing --- osu.Game/Overlays/Chat/DrawableChannel.cs | 11 +++++------ osu.Game/osu.Game.csproj | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/osu.Game/Overlays/Chat/DrawableChannel.cs b/osu.Game/Overlays/Chat/DrawableChannel.cs index ce5d961282..2418eda2b6 100644 --- a/osu.Game/Overlays/Chat/DrawableChannel.cs +++ b/osu.Game/Overlays/Chat/DrawableChannel.cs @@ -48,10 +48,6 @@ namespace osu.Game.Overlays.Chat }, } }; - - Channel.NewMessagesArrived += newMessagesArrived; - Channel.MessageRemoved += messageRemoved; - Channel.PendingMessageResolved += pendingMessageResolved; } protected override void LoadComplete() @@ -59,6 +55,11 @@ namespace osu.Game.Overlays.Chat base.LoadComplete(); newMessagesArrived(Channel.Messages); + + Channel.NewMessagesArrived += newMessagesArrived; + Channel.MessageRemoved += messageRemoved; + Channel.PendingMessageResolved += pendingMessageResolved; + scrollToEnd(); } @@ -78,8 +79,6 @@ namespace osu.Game.Overlays.Chat flow.AddRange(displayMessages.Select(m => new ChatLine(m))); - if (!IsLoaded) return; - if (scroll.IsScrolledToEnd(10) || !flow.Children.Any() || newMessages.Any(m => m is LocalMessage)) scrollToEnd(); diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index a1578b6eb8..85eabb0350 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -18,7 +18,7 @@ - +