condense some overly long code (ty marisa)

This commit is contained in:
in1tiate 2021-04-15 13:49:27 -05:00
parent c9700f236f
commit 122e993a8b

View File

@ -378,25 +378,13 @@ void AOClient::pktAnnounceCase(AreaData* area, int argc, QStringList argv, AOPac
return; return;
needs_list.append(need); needs_list.append(need);
} }
// this is stupid stupid stupid i hate this QStringList roles = {"defense attorney", "prosecutor", "judge", "jurors", "stenographer"};
if (needs_list[0]) { for (int i = 0; i < 5; i++) {
needed_roles.append("defense attorney"); if (needs_list[i])
needed_roles.append(roles[i]);
} }
if (needs_list[1]) { if (needed_roles.isEmpty())
needed_roles.append("prosecutor");
}
if (needs_list[2]) {
needed_roles.append("judge");
}
if (needs_list[3]) {
needed_roles.append("jurors");
}
if (needs_list[4]) {
needed_roles.append("stenographer");
}
if (needed_roles.isEmpty()) {
return; return;
}
QString message = "=== Case Announcement ===\r\n" + ooc_name == "" ? current_char : ooc_name + " needs " + needed_roles.join(", ") + " for " + case_title == "" ? "a case" : case_title + "!"; QString message = "=== Case Announcement ===\r\n" + ooc_name == "" ? current_char : ooc_name + " needs " + needed_roles.join(", ") + " for " + case_title == "" ? "a case" : case_title + "!";