Update courtroom.cpp to apply change requests

This commit is contained in:
Salanto 2021-03-22 20:45:10 +01:00
parent 2c5da36992
commit 298422d453

View File

@ -3677,7 +3677,7 @@ void Courtroom::handle_song(QStringList *p_contents)
if (f_contents.size() < 2) if (f_contents.size() < 2)
return; return;
bool ok, ok2, ok3; //CharID,Channel, Effect bool ok; // Used for charID, channel, effect check
bool looping = false; // No loop due to outdated server using serverside looping bool looping = false; // No loop due to outdated server using serverside looping
int channel = 0; // Channel 0 is 'master music', other for ambient int channel = 0; // Channel 0 is 'master music', other for ambient
int effect_flags = 0; // No effects by default - vanilla functionality int effect_flags = 0; // No effects by default - vanilla functionality
@ -3701,19 +3701,19 @@ void Courtroom::handle_song(QStringList *p_contents)
if (p_contents->length() > 4) { if (p_contents->length() > 4) {
// eyyy we want to change this song's CHANNEL huh // eyyy we want to change this song's CHANNEL huh
// let the music player handle it if it's bigger than the channel list // let the music player handle it if it's bigger than the channel list
channel = p_contents->at(4).toInt(&ok2); channel = p_contents->at(4).toInt(&ok);
if (!ok2) if (!ok)
return; return;
} }
if (p_contents->length() > 5) { if (p_contents->length() > 5) {
// Flags provided to us by server such as Fade In, Fade Out, Sync Pos etc. // Flags provided to us by server such as Fade In, Fade Out, Sync Pos etc.
effect_flags = p_contents->at(5).toInt(&ok3); effect_flags = p_contents->at(5).toInt(&ok);
if (!ok3) if (!ok)
return; return;
} }
bool is_stop = (f_song == "~stop.mp3"); bool is_stop = (f_song == "~stop.mp3");
if (!(n_char < 0) && !(n_char >= char_list.size())) { if (n_char > 0 && n_char < char_list.size()) {
QString str_char = char_list.at(n_char).name; QString str_char = char_list.at(n_char).name;
QString str_show = ao_app->get_showname(str_char); QString str_show = ao_app->get_showname(str_char);
if (p_contents->length() > 2) { if (p_contents->length() > 2) {