diff --git a/core/include/area_data.h b/core/include/area_data.h index 6e15e89..0aeef05 100644 --- a/core/include/area_data.h +++ b/core/include/area_data.h @@ -466,6 +466,13 @@ class AreaData : public QObject { */ QString background() const; + /** + * @brief Sets the background of the area. + * + * @see #AOClient::cmdSetBackground and #m_background + */ + void setBackground(const QString f_background); + /** * @brief Returns if custom shownames are allowed in the area. * diff --git a/core/src/area_data.cpp b/core/src/area_data.cpp index eca662a..672c14f 100644 --- a/core/src/area_data.cpp +++ b/core/src/area_data.cpp @@ -528,6 +528,11 @@ QString AreaData::background() const return m_background; } +void AreaData::setBackground(const QString f_background) +{ + m_background = f_background; +} + bool AreaData::ignoreBgList() { return m_ignoreBgList; diff --git a/core/src/commands/area.cpp b/core/src/commands/area.cpp index 4871242..bf50975 100644 --- a/core/src/commands/area.cpp +++ b/core/src/commands/area.cpp @@ -251,7 +251,7 @@ void AOClient::cmdSetBackground(int argc, QStringList argv) AreaData* area = server->areas[current_area]; if (authenticated || !area->bgLocked()) { if (server->backgrounds.contains(argv[0], Qt::CaseInsensitive) || area->ignoreBgList() == true) { - area->background() = argv[0]; + area->setBackground(argv[0]); server->broadcast(AOPacket("BN", {argv[0]}), current_area); sendServerMessageArea(current_char + " changed the background to " + argv[0]); }