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.

Fix wave duration being wrong.

+18 -18
+18 -18
src/difficulty/lightshow/group.rs
··· 110 110 return 0.0; 111 111 }; 112 112 113 - data.beat_offset 114 - + match self.beat_dist_type { 115 - DistributionType::Wave => { 116 - let base = self.beat_dist_value / filtered_size as f32; 117 - 118 - if let Some(limit_behaviour) = self.filter.limit_behaviour 119 - && let Some(limit_percent) = self.filter.limit_percent 120 - && !limit_behaviour.beat_enabled() 121 - { 122 - base * limit_percent 123 - } else { 124 - base 125 - } 113 + match self.beat_dist_type { 114 + DistributionType::Wave => { 115 + if let Some(limit_behaviour) = self.filter.limit_behaviour 116 + && !limit_behaviour.beat_enabled() 117 + && let Some(limit_percent) = self.filter.limit_percent 118 + && limit_percent != 0.0 119 + { 120 + (self.beat_dist_value * limit_percent).max(data.beat_offset) 121 + } else { 122 + self.beat_dist_value.max(data.beat_offset) 126 123 } 127 - DistributionType::Step => self.beat_dist_value * filtered_size as f32, 128 - DistributionType::Undefined(_) => 0.0, 129 124 } 125 + DistributionType::Step => { 126 + data.beat_offset + self.beat_dist_value * filtered_size as f32 127 + } 128 + DistributionType::Undefined(_) => 0.0, 129 + } 130 130 } 131 131 } 132 132 }; ··· 169 169 ..Default::default() 170 170 }; 171 171 172 - assert_eq!(group.get_duration(12), 1.0); 172 + assert_eq!(group.get_duration(12), 12.0); 173 173 } 174 174 175 175 #[test] ··· 196 196 ..Default::default() 197 197 }; 198 198 199 - assert_eq!(group.get_duration(12), 0.5); 199 + assert_eq!(group.get_duration(12), 6.0); 200 200 } 201 201 202 202 #[test] ··· 228 228 ..Default::default() 229 229 }; 230 230 231 - assert_eq!(group.get_duration(12), 1.0); 231 + assert_eq!(group.get_duration(12), 12.0); 232 232 } 233 233 234 234 #[test]