summaryrefslogtreecommitdiff
path: root/src/net/eathena/buyingstorehandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/eathena/buyingstorehandler.cpp')
-rw-r--r--src/net/eathena/buyingstorehandler.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/net/eathena/buyingstorehandler.cpp b/src/net/eathena/buyingstorehandler.cpp
index 3e3451db2..4ce4378bc 100644
--- a/src/net/eathena/buyingstorehandler.cpp
+++ b/src/net/eathena/buyingstorehandler.cpp
@@ -50,6 +50,7 @@ BuyingStoreHandler::BuyingStoreHandler() :
SMSG_BUYINGSTORE_SHOW_BOARD,
SMSG_BUYINGSTORE_HIDE_BOARD,
SMSG_BUYINGSTORE_ITEMS_LIST,
+ SMSG_BUYINGSTORE_SELL_FAILED,
0
};
handledMessages = _messages;
@@ -84,6 +85,10 @@ void BuyingStoreHandler::handleMessage(Net::MessageIn &msg)
processBuyingStoreItemsList(msg);
break;
+ case SMSG_BUYINGSTORE_SELL_FAILED:
+ processBuyingStoreSellFailed(msg);
+ break;
+
default:
break;
}
@@ -156,6 +161,24 @@ void BuyingStoreHandler::processBuyingStoreItemsList(Net::MessageIn &msg)
}
}
+void BuyingStoreHandler::processBuyingStoreSellFailed(Net::MessageIn &msg)
+{
+ const int16_t result = msg.readInt16("result");
+ switch (result)
+ {
+ case 3:
+ NotifyManager::notify(
+ NotifyTypes::BUYING_STORE_SELL_FAILED_MONEY_LIMIT);
+ break;
+ case 4:
+ NotifyManager::notify(NotifyTypes::BUYING_STORE_SELL_FAILED_EMPTY);
+ break;
+ default:
+ NotifyManager::notify(NotifyTypes::BUYING_STORE_SELL_FAILED);
+ break;
+ }
+}
+
void BuyingStoreHandler::create(const std::string &name,
const int maxMoney,
const bool flag,