This commit is contained in:
Salanto 2021-08-21 11:53:53 +02:00
parent 72aeee3ec0
commit 8daca2eee0

View File

@ -254,12 +254,13 @@ void AOClient::cmdAreaKick(int argc, QStringList argv)
void AOClient::cmdSetBackground(int argc, QStringList argv)
{
QString f_background = argv.join(" ");
AreaData* area = server->areas[current_area];
if (authenticated || !area->bgLocked()) {
if (server->backgrounds.contains(argv[0], Qt::CaseInsensitive) || area->ignoreBgList() == true) {
area->setBackground(argv[0]);
server->broadcast(AOPacket("BN", {argv[0]}), current_area);
sendServerMessageArea(current_char + " changed the background to " + argv[0]);
if (server->backgrounds.contains(f_background, Qt::CaseInsensitive) || area->ignoreBgList() == true) {
area->setBackground(f_background);
server->broadcast(AOPacket("BN", {f_background}), current_area);
sendServerMessageArea(current_char + " changed the background to " + f_background);
}
else {
sendServerMessage("Invalid background name.");