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 pull request #17 from AlephCubed/value-dist-bug

Fix bug when wave distribution value is less than the data offset.

authored by

AlephCubed and committed by
GitHub
4a80d032 588f50d5

+18 -1
+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 }