mirror of
https://git.ethanthesleepy.one/ethanaobrien/ew.git
synced 2025-05-13 11:37:33 -05:00
Fix changing song 1
This commit is contained in:
parent
d4a43d9ef2
commit
7829e01a47
1 changed files with 4 additions and 4 deletions
|
@ -59,15 +59,15 @@ fn switch_music(event: &mut JsonValue, index: i32) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut i = 0;
|
let mut i: i32 = -1;
|
||||||
for (j, live) in event["star_event"]["star_music_list"].members().enumerate() {
|
for (j, live) in event["star_event"]["star_music_list"].members().enumerate() {
|
||||||
if live["position"] == index {
|
if live["position"] == index {
|
||||||
i = j;
|
i = j as i32;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if i != 0 {
|
if i >= 0 {
|
||||||
event["star_event"]["star_music_list"].array_remove(i);
|
event["star_event"]["star_music_list"].array_remove(i as usize);
|
||||||
}
|
}
|
||||||
|
|
||||||
let random_song = get_random_song();
|
let random_song = get_random_song();
|
||||||
|
|
Loading…
Add table
Reference in a new issue