floating point fixes (hopefully)

This commit is contained in:
TheZoroForce240
2025-05-05 17:53:43 +01:00
parent a7415783bc
commit 2b087dc96e
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -203,7 +203,7 @@ final class Conductor
var events:Array<ChartEvent> = [];
for (e in song.events) if (e.params != null && (e.name == "BPM Change" || e.name == "Time Signature Change" || e.name == "Continuous BPM Change")) events.push(e);
events.sort(function(a, b) {
if (a.time == b.time) {
if (MathUtil.equal(a.time, b.time)) {
if (a.name == "Continuous BPM Change") return 1;
if (b.name == "Continuous BPM Change") return -1;
}
@@ -217,7 +217,7 @@ final class Conductor
private static function mapEvent(e:ChartEvent, curChange:BPMChangeEvent) {
var name = e.name, params = e.params, time = e.time;
if (curChange.continuous && time < curChange.endSongTime) { //ensure that you cannot place any conductor events during a continuous change
if (curChange.continuous && MathUtil.lessThan(time, curChange.endSongTime)) { //ensure that you cannot place any conductor events during a continuous change
invalidEvents.push(e);
Logs.trace('Invalid Conductor event "${e.name}" at ${e.time} (Intersecting continuous change!)', WARNING);
return curChange;
@@ -268,7 +268,7 @@ final class Conductor
for(event in Charter.instance.eventsGroup.members) {
event.events.sort(function(a, b) {
if (a.time == b.time) {
if (MathUtil.equal(a.time, b.time)) {
if (a.name == "Continuous BPM Change") return 1;
if (b.name == "Continuous BPM Change") return -1;
}
@@ -38,8 +38,8 @@ class CharterEventTypeSelection extends UISubstateWindow {
var disableConductorEvents:Bool = false;
var disableOnlyContinuousChanges:Bool = false;
for (change in Conductor.bpmChangeMap) {
if (change.continuous && eventStepTime >= change.stepTime && eventStepTime < change.endStepTime) {
disableOnlyContinuousChanges = eventStepTime == change.stepTime; //allow time sig and instant bpm changes on the same event
if (change.continuous && MathUtil.greaterThanEqual(eventStepTime, change.stepTime) && MathUtil.lessThan(eventStepTime, change.endStepTime)) {
disableOnlyContinuousChanges = MathUtil.equal(eventStepTime, change.stepTime); //allow time sig and instant bpm changes on the same event
disableConductorEvents = !disableOnlyContinuousChanges;
}
}