Skip to content

Commit

Permalink
fix chart editor crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Vortex2Oblivion committed Dec 7, 2024
1 parent 1e1e2b6 commit b761541
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions source/game/SoundGroup.hx
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,19 @@ class SoundGroup extends FlxTypedContainer<FlxSound> {
function set_volume(volume:Float):Float {
this.volume = volume;
for (sound in members) {
sound.volume = volume;
if(sound != null){
sound.volume = volume;
}
}
return volume;
}

function set_time(time:Float):Float {
this.time = time;
for (sound in members) {
sound.time = time;
if(sound != null){
sound.time = time;
}
}
return time;
}
Expand All @@ -82,7 +86,10 @@ class SoundGroup extends FlxTypedContainer<FlxSound> {
function set_pitch(pitch:Float):Float {
this.pitch = pitch;
for (sound in members) {
if(sound != null){

sound.pitch = pitch;
}
}
return pitch;
}
Expand All @@ -91,7 +98,7 @@ class SoundGroup extends FlxTypedContainer<FlxSound> {
function get_maxLength():Float {
var m:Float = 0.0;
for (sound in members) {
if (sound.length > m) {
if (sound != null && sound.length > m) {
m = sound.length;
}
}
Expand Down
2 changes: 1 addition & 1 deletion source/toolbox/ChartingState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1610,7 +1610,7 @@ class ChartingState extends MusicBeatState {
}

function changeSection(sec:Int = 0, ?updateMusic:Bool = true):Void {
trace('changing section' + sec);
//trace('changing section' + sec);

if (_song.notes[sec] != null) {
curSection = sec;
Expand Down

0 comments on commit b761541

Please sign in to comment.