Skip to content

Commit

Permalink
Fix: Map stats not updating on gamemode changes & always search for m…
Browse files Browse the repository at this point in the history
…aps if we had no results previously
  • Loading branch information
Piotrekol committed Aug 13, 2021
1 parent bb38fa7 commit 4c6fd4e
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,15 @@ private async Task<IMapSearchResult> FindBeatmaps(IMapSearchArgs mapSearchArgs,
if (mapSearchArgs.MapId == 0 && string.IsNullOrEmpty(mapSearchArgs.MapHash) && string.IsNullOrEmpty(mapSearchArgs.Raw))
return null;

bool performMapSearch = true;
var performMapSearch = true;
if (_workerState.LastProcessingCancelled)
{
_workerState.LastProcessingCancelled = false;
//preserve previous search results if we have same map file with same mods
performMapSearch = string.IsNullOrWhiteSpace(mapSearchArgs.MapHash)
//preserve previous search results if we have same playMode & same map _file hash_ & same mods
performMapSearch = _workerState.LastMapSearchResult == null
|| _workerState.LastMapSearchResult.PlayMode != mapSearchArgs.PlayMode
|| !_workerState.LastMapSearchResult.BeatmapsFound.Any()
|| string.IsNullOrWhiteSpace(mapSearchArgs.MapHash)
|| _workerState.LastMapSearchResult.SearchArgs.MapHash != mapSearchArgs.MapHash
|| _workerState.LastMapSearchResult.SearchArgs.Mods != mapSearchArgs.Mods;
mapSearchArgs.EventType = OsuEventType.MapChange;
Expand Down

0 comments on commit 4c6fd4e

Please sign in to comment.