Merge pull request #179 from Salanto/Fix-#178
Set background in area data when /bg is used.
This commit is contained in:
commit
e84d9dc9ba
@ -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.
|
||||
*
|
||||
|
@ -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;
|
||||
|
@ -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]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user