Beatsaber Rust Utilities: A Beatsaber V3 parsing library.
beatsaber beatmap
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'main' into fx-events

+26 -4
+1 -1
Cargo.lock
··· 156 156 157 157 [[package]] 158 158 name = "bsru" 159 - version = "0.2.0-beta.2" 159 + version = "0.2.0" 160 160 dependencies = [ 161 161 "bevy_color", 162 162 "bevy_reflect",
+1 -1
Cargo.toml
··· 1 1 [package] 2 2 name = "bsru" 3 - version = "0.2.0-beta.2" 3 + version = "0.2.0" 4 4 edition = "2024" 5 5 description = "Beatsaber Rust Utilities: A Beatsaber V3 parsing library." 6 6 categories = ["game-development", "data-structures", "parser-implementations"]
+18 -1
src/difficulty/lightshow.rs
··· 111 111 DistributionType::Wave => { 112 112 let mut modified_value = dist_value; 113 113 if let Some(offset) = last_data_offset { 114 - modified_value -= offset; 114 + modified_value = (modified_value - offset).max(0.0); 115 115 } 116 116 117 117 let mut fraction = filtered_id / filtered_size; ··· 548 548 assert_eq!( 549 549 DistributionType::Step.compute_both(i, 12, &filter, 1.0, None, None), 550 550 i as f32 551 + ); 552 + } 553 + } 554 + 555 + #[test] 556 + fn wave_with_value_less_than_data_offset() { 557 + for i in 0..12 { 558 + assert_eq!( 559 + DistributionType::Wave.compute_both( 560 + i, 561 + 12, 562 + &Filter::default(), 563 + 1.0, 564 + Some(2.0), 565 + None 566 + ), 567 + 0.0 551 568 ); 552 569 } 553 570 }
+6 -1
src/difficulty/lightshow/filter.rs
··· 115 115 } 116 116 } 117 117 118 + #[allow(deprecated)] 118 119 /// Returns the number of light chunks effected by the filter, but before applying the limit. 119 - /// 120 120 /// This is required for distribution calculations. 121 + /// 122 + /// Also see [`count_filtered`](Self::count_filtered). 121 123 /// # Unknown 122 124 /// If the [`FilterType`] is `Unknown` then the result will be the same as `group_size`. 123 125 #[must_use] ··· 144 146 } 145 147 } 146 148 149 + #[allow(deprecated)] 147 150 /// Returns the number of light chunks effected by the filter. 151 + /// 152 + /// Also see [`count_filtered_without_limit`](Self::count_filtered_without_limit). 148 153 /// # Unknown 149 154 /// If the [`FilterType`] is `Unknown` then the result will be the same as `group_size`. 150 155 #[must_use]