summaryrefslogtreecommitdiff
path: root/src/net/eathena/buysellrecv.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/eathena/buysellrecv.cpp')
-rw-r--r--src/net/eathena/buysellrecv.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/net/eathena/buysellrecv.cpp b/src/net/eathena/buysellrecv.cpp
index 0a96ef0df..f817813c6 100644
--- a/src/net/eathena/buysellrecv.cpp
+++ b/src/net/eathena/buysellrecv.cpp
@@ -84,4 +84,32 @@ void BuySellRecv::processNpcSellResponse(Net::MessageIn &msg)
}
}
+void BuySellRecv::processNpcBuyResponse(Net::MessageIn &msg)
+{
+ const uint8_t response = msg.readUInt8("response");
+ if (response == 0U)
+ {
+ NotifyManager::notify(NotifyTypes::BUY_DONE);
+ return;
+ }
+ switch (response)
+ {
+ case 1:
+ NotifyManager::notify(NotifyTypes::BUY_FAILED_NO_MONEY);
+ break;
+
+ case 2:
+ NotifyManager::notify(NotifyTypes::BUY_FAILED_OVERWEIGHT);
+ break;
+
+ case 3:
+ NotifyManager::notify(NotifyTypes::BUY_FAILED_TOO_MANY_ITEMS);
+ break;
+
+ default:
+ NotifyManager::notify(NotifyTypes::BUY_FAILED);
+ break;
+ };
+}
+
} // namespace EAthena