diff options
author | Stefan Dombrowski <stefan@uni-bonn.de> | 2011-04-11 21:07:32 +0200 |
---|---|---|
committer | Stefan Dombrowski <stefan@uni-bonn.de> | 2011-04-11 21:07:32 +0200 |
commit | 13c4a1131854887ac9ec83f80c7964f6b2949c87 (patch) | |
tree | eff4f6cc35faed99536bd4c229ad626695e7eebf /src/net/tmwa/playerhandler.cpp | |
parent | b38c31b289d36b2dae594e44d0e8b5e21f083dc5 (diff) | |
download | mana-13c4a1131854887ac9ec83f80c7964f6b2949c87.tar.gz mana-13c4a1131854887ac9ec83f80c7964f6b2949c87.tar.bz2 mana-13c4a1131854887ac9ec83f80c7964f6b2949c87.tar.xz mana-13c4a1131854887ac9ec83f80c7964f6b2949c87.zip |
Removing annoying NPC trade messages from chat
The thanks messages got removed, because they are useless and when
selling many items they completely trashed the chat.
The pick-up information for money now respects the configuration.
Reviewed-by: thorbjorn
Diffstat (limited to 'src/net/tmwa/playerhandler.cpp')
-rw-r--r-- | src/net/tmwa/playerhandler.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp index 48e7f4b3..a4cd7b15 100644 --- a/src/net/tmwa/playerhandler.cpp +++ b/src/net/tmwa/playerhandler.cpp @@ -21,6 +21,7 @@ #include "net/tmwa/playerhandler.h" +#include "configuration.h" #include "game.h" #include "localplayer.h" #include "log.h" @@ -337,14 +338,20 @@ void PlayerHandler::handleMessage(Net::MessageIn &msg) player_node->setExperience(JOB, msg.readInt32(), player_node->getExperience(JOB).second); break; - case 0x0014: { - int curGp = player_node->getMoney(); + case 0x0014: + { + const int curGp = player_node->getMoney(); player_node->setMoney(msg.readInt32()); - if (player_node->getMoney() > curGp) + if (player_node->getMoney() <= curGp) + break; + std::string money = Units::formatCurrency( + player_node->getMoney() - curGp); + if (config.getValue("showpickupchat", 1)) localChatTab->chatLog(strprintf(_("You picked up " - "%s."), - Units::formatCurrency(player_node->getMoney() - - curGp).c_str()), BY_SERVER); + "%s."), money.c_str()), BY_SERVER); + if (config.getValue("showpickupparticle", 1)) + player_node->addMessageToQueue(money, + UserPalette::PICKUP_INFO); } break; case 0x0016: |