From 095b6e3d86fe30558abfeff084171e405a1f22d9 Mon Sep 17 00:00:00 2001 From: Dennis Friis Date: Sat, 26 Apr 2008 17:37:03 +0000 Subject: When picking up GP from trade or quest, tell the user in the chat window like with items. --- ChangeLog | 3 +++ src/net/playerhandler.cpp | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6cfedec6..81c249cb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,9 @@ * src/inventory.cpp: Avoid stacking equipment other than arrows. Based on similar fix in inventoryhandler. + * src/gui/trade.cpp: Text fix, z => GP. + * src/net/playerhandler.cpp: When picking up GP from trade or quest, + tell the user in the chat window like with items. 2008-04-24 Dennis Friis diff --git a/src/net/playerhandler.cpp b/src/net/playerhandler.cpp index b3355ef8..2502c144 100644 --- a/src/net/playerhandler.cpp +++ b/src/net/playerhandler.cpp @@ -30,6 +30,7 @@ #include "../localplayer.h" #include "../log.h" #include "../npc.h" +#include "../utils/tostring.h" #include "../gui/buy.h" #include "../gui/chat.h" @@ -208,8 +209,14 @@ void PlayerHandler::handleMessage(MessageIn *msg) case 0x0002: player_node->mJobXp = msg->readInt32(); break; - case 0x0014: - player_node->mGp = msg->readInt32(); + case 0x0014: { + Uint32 curGp = player_node->mGp; + player_node->mGp = msg->readInt32(); + if (player_node->mGp > curGp) + chatWindow->chatLog("You picked up " + + toString(player_node->mGp - curGp) + " GP", + BY_SERVER); + } break; case 0x0016: player_node->mXpForNextLevel = msg->readInt32(); -- cgit v1.2.3-70-g09d2