mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 09:23:06 +08:00
Fix conversion regression.
This commit is contained in:
parent
2a422ca5fa
commit
873599b359
@ -44,8 +44,10 @@ namespace osu.Game.Database
|
||||
using (Stream s = storage.GetStream(Path.Combine(replay_folder, replayFilename)))
|
||||
using (SerializationReader sr = new SerializationReader(s))
|
||||
{
|
||||
var ruleset = rulesets.GetRuleset(sr.ReadByte()).CreateInstance();
|
||||
score = new Score();
|
||||
score = new Score
|
||||
{
|
||||
Ruleset = rulesets.GetRuleset(sr.ReadByte())
|
||||
};
|
||||
|
||||
/* score.Pass = true;*/
|
||||
var version = sr.ReadInt32();
|
||||
|
@ -17,6 +17,12 @@ namespace osu.Game.Rulesets
|
||||
|
||||
public abstract IEnumerable<Mod> GetModsFor(ModType type);
|
||||
|
||||
/// <summary>
|
||||
/// Attempt to create a HitRenderer for the provided beatmap.
|
||||
/// </summary>
|
||||
/// <param name="beatmap"></param>
|
||||
/// <exception cref="BeatmapInvalidForRulesetException">Unable to successfully load the beatmap to be usable with this ruleset.</exception>
|
||||
/// <returns></returns>
|
||||
public abstract HitRenderer CreateHitRendererWith(WorkingBeatmap beatmap);
|
||||
|
||||
public abstract DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap);
|
||||
|
@ -81,20 +81,21 @@ namespace osu.Game.Screens.Play
|
||||
if (Beatmap == null)
|
||||
throw new Exception("Beatmap was not loaded");
|
||||
|
||||
ruleset = osu?.Ruleset.Value ?? Beatmap.BeatmapInfo.Ruleset;
|
||||
rulesetInstance = ruleset.CreateInstance();
|
||||
|
||||
try
|
||||
{
|
||||
// Try using the preferred user ruleset
|
||||
ruleset = osu == null ? Beatmap.BeatmapInfo.Ruleset : osu.Ruleset.Value;
|
||||
HitRenderer = rulesetInstance.CreateHitRendererWith(Beatmap);
|
||||
}
|
||||
catch (BeatmapInvalidForModeException)
|
||||
{
|
||||
// Default to the beatmap ruleset
|
||||
// we may fail to create a HitRenderer if the beatmap cannot be loaded with the user's preferred ruleset
|
||||
// let's try again forcing the beatmap's ruleset.
|
||||
ruleset = Beatmap.BeatmapInfo.Ruleset;
|
||||
rulesetInstance = ruleset.CreateInstance();
|
||||
HitRenderer = rulesetInstance.CreateHitRendererWith(Beatmap);
|
||||
}
|
||||
|
||||
rulesetInstance = ruleset.CreateInstance();
|
||||
|
||||
HitRenderer = rulesetInstance.CreateHitRendererWith(Beatmap);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user