diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-06-11 01:00:01 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-06-11 01:00:01 +0300 |
commit | 2f768a34f72560ee8b2934228f548a4909533887 (patch) | |
tree | 0849395dea15a851fcec1a6236c29648cb41add7 /src | |
parent | 05edba87ab0dae7ac4480c86655afe59cd1dd3bd (diff) | |
download | manaplus-2f768a34f72560ee8b2934228f548a4909533887.tar.gz manaplus-2f768a34f72560ee8b2934228f548a4909533887.tar.bz2 manaplus-2f768a34f72560ee8b2934228f548a4909533887.tar.xz manaplus-2f768a34f72560ee8b2934228f548a4909533887.zip |
Rename player_relations into playerRelations.
Diffstat (limited to 'src')
25 files changed, 85 insertions, 85 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index f22d7bc93..0107770fe 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -114,7 +114,7 @@ static void reportRelation(const InputEvent &event, { if (event.tab != nullptr) { - if (player_relations.getRelation(event.args) == rel) + if (playerRelations.getRelation(event.args) == rel) { // TRANSLATORS: unignore command event.tab->chatLog(str1, ChatMsgType::BY_SERVER); @@ -135,7 +135,7 @@ static void changeRelation(const InputEvent &event, if (args.empty()) return; - if (player_relations.getRelation(args) == relation) + if (playerRelations.getRelation(args) == relation) { if (event.tab != nullptr) { @@ -147,7 +147,7 @@ static void changeRelation(const InputEvent &event, } else { - player_relations.setRelation(args, relation); + playerRelations.setRelation(args, relation); } reportRelation(event, @@ -180,10 +180,10 @@ impHandler(chatUnignore) if (args.empty()) return false; - const RelationT rel = player_relations.getRelation(args); + const RelationT rel = playerRelations.getRelation(args); if (rel != Relation::NEUTRAL && rel != Relation::FRIEND) { - player_relations.setRelation(args, Relation::NEUTRAL); + playerRelations.setRelation(args, Relation::NEUTRAL); } else { @@ -211,7 +211,7 @@ impHandler(chatErase) if (args.empty()) return false; - if (player_relations.getRelation(args) == Relation::ERASED) + if (playerRelations.getRelation(args) == Relation::ERASED) { if (event.tab != nullptr) { @@ -223,7 +223,7 @@ impHandler(chatErase) } else { - player_relations.setRelation(args, Relation::ERASED); + playerRelations.setRelation(args, Relation::ERASED); } reportRelation(event, diff --git a/src/actions/statusbar.cpp b/src/actions/statusbar.cpp index 5832d49c0..1555c7233 100644 --- a/src/actions/statusbar.cpp +++ b/src/actions/statusbar.cpp @@ -168,7 +168,7 @@ impHandler0(changeMapMode) impHandler0(changeTrade) { - unsigned int deflt = player_relations.getDefault(); + unsigned int deflt = playerRelations.getDefault(); if ((deflt & PlayerRelation::TRADE) != 0u) { if (localChatTab != nullptr) @@ -190,7 +190,7 @@ impHandler0(changeTrade) deflt |= PlayerRelation::TRADE; } - player_relations.setDefault(deflt); + playerRelations.setDefault(deflt); return true; } diff --git a/src/actormanager.cpp b/src/actormanager.cpp index 5f1bf8157..44e8e7cb7 100644 --- a/src/actormanager.cpp +++ b/src/actormanager.cpp @@ -1466,7 +1466,7 @@ void ActorManager::heal(const Being *const target) const target->getType() != ActorType::Monster) { // target not enemy - if (player_relations.getRelation(target->getName()) != + if (playerRelations.getRelation(target->getName()) != Relation::ENEMY2) { if (!PacketLimiter::limitPackets(PacketType::PACKET_CHAT)) @@ -1512,7 +1512,7 @@ Being* ActorManager::findMostDamagedPlayer(const int maxTileDist) const Being *const being = static_cast<Being*>(*it); if ((being == nullptr) || !being->isAlive() || // don't heal dead - player_relations.getRelation(being->getName()) == + playerRelations.getRelation(being->getName()) == Relation::ENEMY2 || // don't heal enemy localPlayer == being) // don't heal self { diff --git a/src/being/being.cpp b/src/being/being.cpp index deac96e2c..97492d431 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -2461,7 +2461,7 @@ void Being::showName() restrict2 delete2(mDispName); - if (mHideErased && player_relations.getRelation(mName) == Relation::ERASED) + if (mHideErased && playerRelations.getRelation(mName) == Relation::ERASED) return; std::string displayName(mName); @@ -2488,7 +2488,7 @@ void Being::showName() restrict2 font = boldFont; } else if (mType == ActorType::Player - && !player_relations.isGoodName(this) && (gui != nullptr)) + && !playerRelations.isGoodName(this) && (gui != nullptr)) { font = gui->getSecureFont(); } @@ -2573,7 +2573,7 @@ void Being::updateColors() { mTextColor = &theme->getColor(ThemeColorId::PLAYER, 255); - if (player_relations.getRelation(mName) != Relation::ERASED) + if (playerRelations.getRelation(mName) != Relation::ERASED) mErased = false; else mErased = true; @@ -2597,24 +2597,24 @@ void Being::updateColors() { mNameColor = &userPalette->getColor(UserColorId::GUILD); } - else if (player_relations.getRelation(mName) == Relation::FRIEND) + else if (playerRelations.getRelation(mName) == Relation::FRIEND) { mNameColor = &userPalette->getColor(UserColorId::FRIEND); } - else if (player_relations.getRelation(mName) == + else if (playerRelations.getRelation(mName) == Relation::DISREGARDED - || player_relations.getRelation(mName) == + || playerRelations.getRelation(mName) == Relation::BLACKLISTED) { mNameColor = &userPalette->getColor(UserColorId::DISREGARDED); } - else if (player_relations.getRelation(mName) + else if (playerRelations.getRelation(mName) == Relation::IGNORED || - player_relations.getRelation(mName) == Relation::ENEMY2) + playerRelations.getRelation(mName) == Relation::ENEMY2) { mNameColor = &userPalette->getColor(UserColorId::IGNORED); } - else if (player_relations.getRelation(mName) == Relation::ERASED) + else if (playerRelations.getRelation(mName) == Relation::ERASED) { mNameColor = &userPalette->getColor(UserColorId::ERASED); } diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index 5c275b3f6..e2b126065 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -2742,10 +2742,10 @@ bool LocalPlayer::checAttackPermissions(const Being *const target) case 0: return true; case 1: - return !(player_relations.getRelation(target->mName) + return !(playerRelations.getRelation(target->mName) == Relation::FRIEND); case 2: - return player_relations.checkBadRelation(target->mName); + return playerRelations.checkBadRelation(target->mName); default: case 3: return false; diff --git a/src/being/playerrelations.cpp b/src/being/playerrelations.cpp index e45376137..690665b15 100644 --- a/src/being/playerrelations.cpp +++ b/src/being/playerrelations.cpp @@ -455,7 +455,7 @@ void PlayerRelationsManager::ignoreTrade(const std::string &name) const } else { - player_relations.setRelation(name, Relation::BLACKLISTED); + playerRelations.setRelation(name, Relation::BLACKLISTED); } } @@ -661,4 +661,4 @@ bool PlayerRelationsManager::checkName(const std::string &name) } } -PlayerRelationsManager player_relations; +PlayerRelationsManager playerRelations; diff --git a/src/being/playerrelations.h b/src/being/playerrelations.h index ae2e08dae..c9e5952f2 100644 --- a/src/being/playerrelations.h +++ b/src/being/playerrelations.h @@ -206,8 +206,8 @@ class PlayerRelationsManager final }; -extern PlayerRelationsManager player_relations; // singleton representation - // of player relations +extern PlayerRelationsManager playerRelations; // singleton representation + // of player relations #endif // BEING_PLAYERRELATIONS_H diff --git a/src/client.cpp b/src/client.cpp index 750c17bd2..2bce1bad6 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -473,7 +473,7 @@ void Client::gameInit() inputManager.init(); // Initialise player relations - player_relations.init(); + playerRelations.init(); Joystick::init(); WindowManager::createWindows(); @@ -696,7 +696,7 @@ void Client::gameClear() delete2(emoteShortcut); delete2(dropShortcut); - player_relations.store(); + playerRelations.store(); if (logger != nullptr) logger->log1("Quitting2"); @@ -824,7 +824,7 @@ void Client::stateConnectServer1() PacketLimiter::initPacketLimiter(); initTradeFilter(); Dirs::initUsersDir(); - player_relations.init(); + playerRelations.init(); // Initialize the item and emote shortcuts. for (unsigned f = 0; f < SHORTCUT_TABS; f ++) diff --git a/src/gui/models/ignorechoiceslistmodel.h b/src/gui/models/ignorechoiceslistmodel.h index b0010df31..ef537a5c7 100644 --- a/src/gui/models/ignorechoiceslistmodel.h +++ b/src/gui/models/ignorechoiceslistmodel.h @@ -45,7 +45,7 @@ class IgnoreChoicesListModel final : public ListModel int getNumberOfElements() override final { - return CAST_S32(player_relations. + return CAST_S32(playerRelations. getPlayerIgnoreStrategies()->size()); } @@ -54,7 +54,7 @@ class IgnoreChoicesListModel final : public ListModel if (i >= getNumberOfElements() || i < 0) return "???"; - return (*player_relations.getPlayerIgnoreStrategies()) + return (*playerRelations.getPlayerIgnoreStrategies()) [i]->mDescription; } }; diff --git a/src/gui/models/playertablemodel.cpp b/src/gui/models/playertablemodel.cpp index 9c8526e0d..417fafcbc 100644 --- a/src/gui/models/playertablemodel.cpp +++ b/src/gui/models/playertablemodel.cpp @@ -95,7 +95,7 @@ void PlayerTableModel::playerRelationsUpdated() signalBeforeUpdate(); freeWidgets(); - StringVect *const player_names = player_relations.getPlayers(); + StringVect *const player_names = playerRelations.getPlayers(); delete mPlayers; mPlayers = player_names; @@ -109,7 +109,7 @@ void PlayerTableModel::playerRelationsUpdated() DropDown *const choicebox = new DropDown(this, mListModel); choicebox->setSelected(CAST_S32( - player_relations.getRelation(name))); + playerRelations.getRelation(name))); mWidgets.push_back(choicebox); } @@ -122,7 +122,7 @@ void PlayerTableModel::updateModelInRow(const int row) const getElementAt(row, RELATION_CHOICE_COLUMN)); if (choicebox == nullptr) return; - player_relations.setRelation(getPlayerAt(row), + playerRelations.setRelation(getPlayerAt(row), static_cast<RelationT>( choicebox->getSelected())); } diff --git a/src/gui/popups/beingpopup.cpp b/src/gui/popups/beingpopup.cpp index 1834fcbe9..4cafcca27 100644 --- a/src/gui/popups/beingpopup.cpp +++ b/src/gui/popups/beingpopup.cpp @@ -103,7 +103,7 @@ void BeingPopup::show(const int x, const int y, Being *const b) mBeingName->setCaption(b->getName() + b->getGenderSignWithSpace()); if (gui != nullptr) { - if (player_relations.isGoodName(b)) + if (playerRelations.isGoodName(b)) mBeingName->setFont(boldFont); else mBeingName->setFont(gui->getSecureFont()); diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index 0dbcaac2f..a01ab6bf8 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -2400,7 +2400,7 @@ void PopupMenu::addNormalRelations() void PopupMenu::addPlayerRelation(const std::string &name) { - switch (player_relations.getRelation(name)) + switch (playerRelations.getRelation(name)) { case Relation::NEUTRAL: // TRANSLATORS: popup menu item @@ -2501,7 +2501,7 @@ void PopupMenu::addFollow() void PopupMenu::addBuySell(const Being *const being) { - if ((player_relations.getDefault() & PlayerRelation::TRADE) != 0u) + if ((playerRelations.getDefault() & PlayerRelation::TRADE) != 0u) { mBrowserBox->addRow("##3---"); const bool haveVending = @@ -2535,7 +2535,7 @@ void PopupMenu::addBuySell(const Being *const being) void PopupMenu::addBuySellDefault() { - if ((player_relations.getDefault() & PlayerRelation::TRADE) != 0u) + if ((playerRelations.getDefault() & PlayerRelation::TRADE) != 0u) { mBrowserBox->addRow("##3---"); // TRANSLATORS: popup menu item diff --git a/src/gui/widgets/tabs/setup_relations.cpp b/src/gui/widgets/tabs/setup_relations.cpp index d81bca9a9..4cc81a300 100644 --- a/src/gui/widgets/tabs/setup_relations.cpp +++ b/src/gui/widgets/tabs/setup_relations.cpp @@ -70,10 +70,10 @@ Setup_Relations::Setup_Relations(const Widget2 *const widget) : mPlayerScrollArea(new ScrollArea(this, mPlayerTable)), // TRANSLATORS: relation dialog button mDefaultTrading(new CheckBox(this, _("Allow trading"), - (player_relations.getDefault() & PlayerRelation::TRADE) != 0u)), + (playerRelations.getDefault() & PlayerRelation::TRADE) != 0u)), // TRANSLATORS: relation dialog button mDefaultWhisper(new CheckBox(this, _("Allow whispers"), - (player_relations.getDefault() & PlayerRelation::WHISPER) != 0u)), + (playerRelations.getDefault() & PlayerRelation::WHISPER) != 0u)), // TRANSLATORS: relation dialog button mDeleteButton(new Button(this, _("Delete"), ACTION_DELETE, this)), mIgnoreActionChoicesModel(new IgnoreChoicesListModel), @@ -112,10 +112,10 @@ Setup_Relations::Setup_Relations(const Widget2 *const widget) : int ignore_strategy_index = 0; // safe default - if (player_relations.getPlayerIgnoreStrategy() != nullptr) + if (playerRelations.getPlayerIgnoreStrategy() != nullptr) { - ignore_strategy_index = player_relations.getPlayerIgnoreStrategyIndex( - player_relations.getPlayerIgnoreStrategy()->mShortName); + ignore_strategy_index = playerRelations.getPlayerIgnoreStrategyIndex( + playerRelations.getPlayerIgnoreStrategy()->mShortName); if (ignore_strategy_index < 0) ignore_strategy_index = 0; } @@ -136,14 +136,14 @@ Setup_Relations::Setup_Relations(const Widget2 *const widget) : place(3, 6, mDefaultTrading, 3); place(3, 7, mDefaultWhisper, 3); - player_relations.addListener(this); + playerRelations.addListener(this); setDimension(Rect(0, 0, 500, 350)); } Setup_Relations::~Setup_Relations() { - player_relations.removeListener(this); + playerRelations.removeListener(this); delete2(mIgnoreActionChoicesModel); } @@ -152,13 +152,13 @@ void Setup_Relations::reset() { // We now have to search through the list of ignore choices to find the // current selection. We could use an index into the table of config - // options in player_relations instead of strategies to sidestep this. + // options in playerRelations instead of strategies to sidestep this. int selection = 0; - for (size_t i = 0, sz = player_relations.getPlayerIgnoreStrategies() + for (size_t i = 0, sz = playerRelations.getPlayerIgnoreStrategies() ->size(); i < sz; ++ i) { - if ((*player_relations.getPlayerIgnoreStrategies())[i] == - player_relations.getPlayerIgnoreStrategy()) + if ((*playerRelations.getPlayerIgnoreStrategies())[i] == + playerRelations.getPlayerIgnoreStrategy()) { selection = CAST_S32(i); break; @@ -169,11 +169,11 @@ void Setup_Relations::reset() void Setup_Relations::apply() { - player_relations.store(); + playerRelations.store(); - const unsigned int old_default_relations = player_relations.getDefault() & + const unsigned int old_default_relations = playerRelations.getDefault() & ~(PlayerRelation::TRADE | PlayerRelation::WHISPER); - player_relations.setDefault(old_default_relations + playerRelations.setDefault(old_default_relations | (mDefaultTrading->isSelected() ? PlayerRelation::TRADE : 0) | (mDefaultWhisper->isSelected() ? PlayerRelation::WHISPER : 0)); @@ -197,13 +197,13 @@ void Setup_Relations::action(const ActionEvent &event) // so there is no need for asynchronous updates. (In fact, thouse // might destroy the widet that triggered them, which would be rather // embarrassing.) - player_relations.removeListener(this); + playerRelations.removeListener(this); const int row = mPlayerTable->getSelectedRow(); if (row >= 0) mPlayerTableModel->updateModelInRow(row); - player_relations.addListener(this); + playerRelations.addListener(this); } else if (eventId == ACTION_DELETE) { @@ -212,7 +212,7 @@ void Setup_Relations::action(const ActionEvent &event) if (player_index < 0) return; - player_relations.removePlayer(mPlayerTableModel->getPlayerAt( + playerRelations.removePlayer(mPlayerTableModel->getPlayerAt( player_index)); } else if (eventId == ACTION_STRATEGY) @@ -221,9 +221,9 @@ void Setup_Relations::action(const ActionEvent &event) if (sel < 0) return; PlayerIgnoreStrategy *const s = - (*player_relations.getPlayerIgnoreStrategies())[sel]; + (*playerRelations.getPlayerIgnoreStrategies())[sel]; - player_relations.setPlayerIgnoreStrategy(s); + playerRelations.setPlayerIgnoreStrategy(s); } } @@ -231,9 +231,9 @@ void Setup_Relations::updatedPlayer(const std::string &name A_UNUSED) { mPlayerTableModel->playerRelationsUpdated(); mDefaultTrading->setSelected( - (player_relations.getDefault() & PlayerRelation::TRADE) != 0u); + (playerRelations.getDefault() & PlayerRelation::TRADE) != 0u); mDefaultWhisper->setSelected( - (player_relations.getDefault() & PlayerRelation::WHISPER) != 0u); + (playerRelations.getDefault() & PlayerRelation::WHISPER) != 0u); if (localPlayer != nullptr) localPlayer->updateName(); } @@ -246,10 +246,10 @@ void Setup_Relations::updateAll() mPlayerTableModel = model; int ignore_strategy_index = 0; // safe default - if (player_relations.getPlayerIgnoreStrategy() != nullptr) + if (playerRelations.getPlayerIgnoreStrategy() != nullptr) { - ignore_strategy_index = player_relations.getPlayerIgnoreStrategyIndex( - player_relations.getPlayerIgnoreStrategy()->mShortName); + ignore_strategy_index = playerRelations.getPlayerIgnoreStrategyIndex( + playerRelations.getPlayerIgnoreStrategy()->mShortName); if (ignore_strategy_index < 0) ignore_strategy_index = 0; } @@ -260,7 +260,7 @@ void Setup_Relations::updateAll() void Setup_Relations::externalUpdated() { mDefaultTrading->setSelected( - (player_relations.getDefault() & PlayerRelation::TRADE) != 0u); + (playerRelations.getDefault() & PlayerRelation::TRADE) != 0u); mDefaultWhisper->setSelected( - (player_relations.getDefault() & PlayerRelation::WHISPER) != 0u); + (playerRelations.getDefault() & PlayerRelation::WHISPER) != 0u); } diff --git a/src/gui/widgets/tabs/socialfriendstab.h b/src/gui/widgets/tabs/socialfriendstab.h index dfae61090..9c9525cd3 100644 --- a/src/gui/widgets/tabs/socialfriendstab.h +++ b/src/gui/widgets/tabs/socialfriendstab.h @@ -85,7 +85,7 @@ class SocialFriendsTab final : public SocialTab avatars->clear(); const StringVect *const players - = player_relations.getPlayersByRelation(Relation::FRIEND); + = playerRelations.getPlayersByRelation(Relation::FRIEND); const std::set<std::string> &players2 = whoIsOnline->getOnlineNicks(); diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index 88d4d3fc5..80c24af0a 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -636,10 +636,10 @@ void ChatWindow::ignoreAllWhispers() WhisperTab *const tab = iter->second; if (tab != nullptr) { - if (player_relations.getRelation(tab->getNick()) + if (playerRelations.getRelation(tab->getNick()) != Relation::IGNORED) { - player_relations.setRelation(tab->getNick(), + playerRelations.setRelation(tab->getNick(), Relation::IGNORED); } tab->handleCommand("close", ""); @@ -1200,7 +1200,7 @@ WhisperTab *ChatWindow::addWhisperTab(const std::string &caption, else { ret = new WhisperTab(this, caption, nick); - if ((gui != nullptr) && !player_relations.isGoodName(nick)) + if ((gui != nullptr) && !playerRelations.isGoodName(nick)) ret->setLabelFont(gui->getSecureFont()); mWhispers[tempNick] = ret; if (config.getBoolValue("showChatHistory")) diff --git a/src/gui/windows/shopwindow.cpp b/src/gui/windows/shopwindow.cpp index 9f4872e62..54656a66b 100644 --- a/src/gui/windows/shopwindow.cpp +++ b/src/gui/windows/shopwindow.cpp @@ -260,7 +260,7 @@ void ShopWindow::action(const ActionEvent &event) } else if (eventId == "ignore") { - player_relations.ignoreTrade(mTradeNick); + playerRelations.ignoreTrade(mTradeNick); mTradeNick.clear(); } else if (eventId == "announce") diff --git a/src/gui/windows/socialwindow.cpp b/src/gui/windows/socialwindow.cpp index 11207d47f..b3f3317a3 100644 --- a/src/gui/windows/socialwindow.cpp +++ b/src/gui/windows/socialwindow.cpp @@ -143,12 +143,12 @@ void SocialWindow::postInit() enableVisibleSound(true); updateButtons(); - player_relations.addListener(this); + playerRelations.addListener(this); } SocialWindow::~SocialWindow() { - player_relations.removeListener(this); + playerRelations.removeListener(this); if (mGuildAcceptDialog != nullptr) { mGuildAcceptDialog->close(); diff --git a/src/gui/windows/tradewindow.cpp b/src/gui/windows/tradewindow.cpp index 295f60a7d..b86d86aa3 100644 --- a/src/gui/windows/tradewindow.cpp +++ b/src/gui/windows/tradewindow.cpp @@ -508,7 +508,7 @@ void TradeWindow::initTrade(const std::string &nick) } } clear(); - if (!player_relations.isGoodName(nick)) + if (!playerRelations.isGoodName(nick)) setCaptionFont(gui->getSecureFont()); } diff --git a/src/gui/windows/whoisonline.cpp b/src/gui/windows/whoisonline.cpp index e5040077a..966807e58 100644 --- a/src/gui/windows/whoisonline.cpp +++ b/src/gui/windows/whoisonline.cpp @@ -288,7 +288,7 @@ void WhoIsOnline::handlerPlayerRelation(const std::string &nick, { if (player == nullptr) return; - switch (player_relations.getRelation(nick)) + switch (playerRelations.getRelation(nick)) { case Relation::NEUTRAL: default: diff --git a/src/listeners/requesttradelistener.h b/src/listeners/requesttradelistener.h index ef94d267a..577d75c3c 100644 --- a/src/listeners/requesttradelistener.h +++ b/src/listeners/requesttradelistener.h @@ -50,7 +50,7 @@ struct RequestTradeListener final : public ActionListener confirmDlg = nullptr; const std::string &eventId = event.getId(); if (eventId == "ignore") - player_relations.ignoreTrade(tradePartnerName); + playerRelations.ignoreTrade(tradePartnerName); tradeHandler->respond(eventId == "yes"); } }; diff --git a/src/net/ea/beingrecv.cpp b/src/net/ea/beingrecv.cpp index 2c5eab9e3..b6e848bc5 100644 --- a/src/net/ea/beingrecv.cpp +++ b/src/net/ea/beingrecv.cpp @@ -260,7 +260,7 @@ void BeingRecv::processBeingEmotion(Net::MessageIn &msg) const uint8_t emote = msg.readUInt8("emote"); if ((emote != 0u) && - player_relations.hasPermission(dstBeing, PlayerRelation::EMOTE)) + playerRelations.hasPermission(dstBeing, PlayerRelation::EMOTE)) { dstBeing->setEmote(emote, 0); localPlayer->imitateEmote(dstBeing, emote); diff --git a/src/net/ea/traderecv.cpp b/src/net/ea/traderecv.cpp index 9b5799c69..d47fc256b 100644 --- a/src/net/ea/traderecv.cpp +++ b/src/net/ea/traderecv.cpp @@ -83,7 +83,7 @@ void TradeRecv::processTradeResponseContinue(const uint8_t type) } break; case 4: // Trade cancelled - if (player_relations.hasPermission(tradePartnerName, + if (playerRelations.hasPermission(tradePartnerName, PlayerRelation::SPEECH_LOG)) { NotifyManager::notify(NotifyTypes::TRADE_CANCELLED_NAME, @@ -141,7 +141,7 @@ void TradeRecv::processTradeComplete(Net::MessageIn &msg A_UNUSED) void TradeRecv::processTradeRequestContinue(const std::string &partner) { - if (player_relations.hasPermission(partner, + if (playerRelations.hasPermission(partner, PlayerRelation::TRADE)) { if (PlayerInfo::isTrading() == Trading_true || (confirmDlg != nullptr)) diff --git a/src/net/eathena/chatrecv.cpp b/src/net/eathena/chatrecv.cpp index 36bcc5bfe..9e766be83 100644 --- a/src/net/eathena/chatrecv.cpp +++ b/src/net/eathena/chatrecv.cpp @@ -486,7 +486,7 @@ void ChatRecv::processWhisperContinue(const std::string &nick, if (nick != "Server") { - if (player_relations.hasPermission(nick, PlayerRelation::WHISPER)) + if (playerRelations.hasPermission(nick, PlayerRelation::WHISPER)) chatWindow->addWhisper(nick, chatMsg); } else if (localChatTab != nullptr) @@ -537,7 +537,7 @@ void ChatRecv::processBeingChat(Net::MessageIn &msg) // We use getIgnorePlayer instead of ignoringPlayer here // because ignorePlayer' side effects are triggered // right below for Being::IGNORE_SPEECH_FLOAT. - if ((player_relations.checkPermissionSilently(sender_name, + if ((playerRelations.checkPermissionSilently(sender_name, PlayerRelation::SPEECH_LOG) != 0u) && (chatWindow != nullptr)) { allow = chatWindow->resortChatLog( @@ -550,7 +550,7 @@ void ChatRecv::processBeingChat(Net::MessageIn &msg) if (allow && being != nullptr && - player_relations.hasPermission(sender_name, + playerRelations.hasPermission(sender_name, PlayerRelation::SPEECH_FLOAT)) { being->setSpeech(chatMsg, GENERAL_CHANNEL); diff --git a/src/net/tmwa/chatrecv.cpp b/src/net/tmwa/chatrecv.cpp index 0d90a6f99..62150a2ad 100644 --- a/src/net/tmwa/chatrecv.cpp +++ b/src/net/tmwa/chatrecv.cpp @@ -184,11 +184,11 @@ void ChatRecv::processWhisperContinue(const std::string &nick, return; } - if (player_relations.hasPermission(nick, PlayerRelation::WHISPER)) + if (playerRelations.hasPermission(nick, PlayerRelation::WHISPER)) { const bool tradeBot = config.getBoolValue("tradebot"); const bool showMsg = !config.getBoolValue("hideShopMessages"); - if (player_relations.hasPermission(nick, PlayerRelation::TRADE)) + if (playerRelations.hasPermission(nick, PlayerRelation::TRADE)) { if (shopWindow != nullptr) { // commands to shop from player @@ -341,7 +341,7 @@ void ChatRecv::processBeingChat(Net::MessageIn &msg) // We use getIgnorePlayer instead of ignoringPlayer here // because ignorePlayer' side effects are triggered // right below for Being::IGNORE_SPEECH_FLOAT. - if ((player_relations.checkPermissionSilently(sender_name, + if ((playerRelations.checkPermissionSilently(sender_name, PlayerRelation::SPEECH_LOG) != 0u) && (chatWindow != nullptr)) { @@ -355,7 +355,7 @@ void ChatRecv::processBeingChat(Net::MessageIn &msg) if (allow && (being != nullptr) && - player_relations.hasPermission(sender_name, + playerRelations.hasPermission(sender_name, PlayerRelation::SPEECH_FLOAT)) { being->setSpeech(chatMsg, GENERAL_CHANNEL); diff --git a/src/net/tmwa/traderecv.cpp b/src/net/tmwa/traderecv.cpp index f846de3c0..d799d9f91 100644 --- a/src/net/tmwa/traderecv.cpp +++ b/src/net/tmwa/traderecv.cpp @@ -157,7 +157,7 @@ void TradeRecv::processTradeItemAddResponse(Net::MessageIn &msg) void TradeRecv::processTradeResponse(Net::MessageIn &msg) { if (tradePartnerName.empty() || - !player_relations.hasPermission(tradePartnerName, + !playerRelations.hasPermission(tradePartnerName, PlayerRelation::TRADE)) { tradeHandler->respond(false); |