File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed
DXMainClient/DXGUI/Multiplayer Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -48,19 +48,23 @@ private async Task MapTextureLoadingService(CancellationToken cancellationToken)
48
48
if ( mapTextures . Count > MaxCacheSize )
49
49
mapTextures . Clear ( ) ;
50
50
51
- var missedMapCopy = missedMaps . ToArray ( ) ;
52
- foreach ( ( Map missedMap , _ ) in missedMapCopy )
51
+ if ( missedMaps . IsEmpty )
53
52
{
54
- if ( mapTextures . Count > MaxCacheSize )
55
- break ;
53
+ var missedMapCopy = missedMaps . ToArray ( ) ;
54
+ foreach ( ( Map missedMap , _ ) in missedMapCopy )
55
+ {
56
+ if ( mapTextures . Count > MaxCacheSize )
57
+ break ;
56
58
57
- missedMaps . TryRemove ( missedMap , out _ ) ;
59
+ missedMaps . TryRemove ( missedMap , out _ ) ;
58
60
59
- if ( mapTextures . ContainsKey ( missedMap ) )
60
- continue ;
61
+ if ( mapTextures . ContainsKey ( missedMap ) )
62
+ continue ;
63
+
64
+ Image image = await Task . Run ( missedMap . ExtractMapPreview ) ;
65
+ mapTextures . TryAdd ( missedMap , image ) ;
66
+ }
61
67
62
- Image image = await Task . Run ( missedMap . ExtractMapPreview ) ;
63
- mapTextures . TryAdd ( missedMap , image ) ;
64
68
}
65
69
66
70
await Task . Delay ( SleepIntervalMS ) ;
You can’t perform that action at this time.
0 commit comments