File tree 1 file changed +13
-2
lines changed
osu.Game/Screens/Play/HUD
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 3
3
4
4
using osu . Framework . Allocation ;
5
5
using osu . Framework . Bindables ;
6
+ using osu . Framework . Extensions ;
6
7
using osu . Framework . Graphics ;
7
8
using osu . Framework . Graphics . Containers ;
9
+ using osu . Game . Database ;
8
10
using osu . Game . Online . API ;
9
11
using osu . Game . Online . API . Requests . Responses ;
10
12
using osu . Game . Skinning ;
@@ -40,10 +42,19 @@ public PlayerTeamFlag()
40
42
}
41
43
42
44
[ BackgroundDependencyLoader ]
43
- private void load ( )
45
+ private void load ( UserLookupCache userLookupCache )
44
46
{
45
47
if ( gameplayState != null )
46
- flag . Team = gameplayState . Score . ScoreInfo . User . Team ;
48
+ {
49
+ if ( gameplayState . Score . ScoreInfo . User . Team != null )
50
+ flag . Team = gameplayState . Score . ScoreInfo . User . Team ;
51
+ else
52
+ {
53
+ // We only store very basic information about a user to realm, so there's a high chance we don't have the team information.
54
+ userLookupCache . GetUserAsync ( gameplayState . Score . ScoreInfo . User . Id )
55
+ . ContinueWith ( task => Schedule ( ( ) => flag . Team = task . GetResultSafely ( ) ? . Team ) ) ;
56
+ }
57
+ }
47
58
else
48
59
{
49
60
apiUser = api . LocalUser . GetBoundCopy ( ) ;
You can’t perform that action at this time.
0 commit comments