1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 18:23:04 +08:00

Consider OnlineIDs during ruleset equality if available

Required for `APIBeatmap`s, which provide `Ruleset` instances with `OnlineID` available only.

Also consistent with the comparer implementation.
This commit is contained in:
Salman Ahmed 2022-02-11 04:17:24 +03:00
parent 1b729e891d
commit 26839f6ad8

View File

@ -44,6 +44,9 @@ namespace osu.Game.Rulesets
if (ReferenceEquals(this, other)) return true; if (ReferenceEquals(this, other)) return true;
if (other == null) return false; if (other == null) return false;
if (OnlineID >= 0 && other.OnlineID >= 0)
return OnlineID == other.OnlineID;
return ShortName == other.ShortName; return ShortName == other.ShortName;
} }