mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 14:12:56 +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 (Stream s = storage.GetStream(Path.Combine(replay_folder, replayFilename)))
|
||||||
using (SerializationReader sr = new SerializationReader(s))
|
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;*/
|
/* score.Pass = true;*/
|
||||||
var version = sr.ReadInt32();
|
var version = sr.ReadInt32();
|
||||||
|
@ -17,6 +17,12 @@ namespace osu.Game.Rulesets
|
|||||||
|
|
||||||
public abstract IEnumerable<Mod> GetModsFor(ModType type);
|
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 HitRenderer CreateHitRendererWith(WorkingBeatmap beatmap);
|
||||||
|
|
||||||
public abstract DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap);
|
public abstract DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap);
|
||||||
|
@ -81,21 +81,22 @@ namespace osu.Game.Screens.Play
|
|||||||
if (Beatmap == null)
|
if (Beatmap == null)
|
||||||
throw new Exception("Beatmap was not loaded");
|
throw new Exception("Beatmap was not loaded");
|
||||||
|
|
||||||
|
ruleset = osu?.Ruleset.Value ?? Beatmap.BeatmapInfo.Ruleset;
|
||||||
|
rulesetInstance = ruleset.CreateInstance();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Try using the preferred user ruleset
|
HitRenderer = rulesetInstance.CreateHitRendererWith(Beatmap);
|
||||||
ruleset = osu == null ? Beatmap.BeatmapInfo.Ruleset : osu.Ruleset.Value;
|
|
||||||
}
|
}
|
||||||
catch (BeatmapInvalidForModeException)
|
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;
|
ruleset = Beatmap.BeatmapInfo.Ruleset;
|
||||||
}
|
|
||||||
|
|
||||||
rulesetInstance = ruleset.CreateInstance();
|
rulesetInstance = ruleset.CreateInstance();
|
||||||
|
|
||||||
HitRenderer = rulesetInstance.CreateHitRendererWith(Beatmap);
|
HitRenderer = rulesetInstance.CreateHitRendererWith(Beatmap);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Logger.Log($"Could not load this beatmap sucessfully ({e})!", LoggingTarget.Runtime, LogLevel.Error);
|
Logger.Log($"Could not load this beatmap sucessfully ({e})!", LoggingTarget.Runtime, LogLevel.Error);
|
||||||
|
Loading…
Reference in New Issue
Block a user