fixed handling missing diff attrs

This commit is contained in:
MaxOhn
2022-03-16 10:39:13 +01:00
parent db4aa46e2b
commit 2f9087825d
2 changed files with 7 additions and 4 deletions
+1
View File
@@ -2,6 +2,7 @@
- osu: Fix panic on maps with 0 objects
- Fixed timing point parsing on some (older) maps where "uninherited" value did not coincide with beat length
- Fixed handling .osu files with missing difficulty attributes
- Added `AttributeProvider` impl for `{Mode}PerformanceAttributes`
- [BREAKING] Store `HitObject::sound` in `Beatmap::sounds` instead to reduce the struct size
- [BREAKING] Removed the mode features `osu`, `fruits`, `taiko`, and `mania`. Now all modes are always supported.
+6 -4
View File
@@ -213,10 +213,12 @@ macro_rules! parse_difficulty_body {
$buf.clear();
}
$self.od = od.next_field("od")?;
$self.cs = cs.next_field("cs")?;
$self.hp = hp.next_field("hp")?;
$self.ar = ar.unwrap_or($self.od);
const DEFAULT_DIFFICULTY: f32 = 5.0;
$self.od = od.unwrap_or(DEFAULT_DIFFICULTY);
$self.cs = cs.unwrap_or(DEFAULT_DIFFICULTY);
$self.hp = hp.unwrap_or(DEFAULT_DIFFICULTY);
$self.ar = ar.unwrap_or(DEFAULT_DIFFICULTY);
$self.slider_mult = sv.next_field("sv")?;
$self.tick_rate = tick_rate.next_field("tick rate")?;