diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-08-25 00:21:24 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-08-25 00:21:24 +0300 |
commit | 3874b588e2a9d70eb678c8a33785a575b16fa7b2 (patch) | |
tree | 430a7a47663b8eee6bc1df8a07d36795547e2c22 | |
parent | 595272de98760925cc3629455f16d023906ef89e (diff) | |
download | mv-3874b588e2a9d70eb678c8a33785a575b16fa7b2.tar.gz mv-3874b588e2a9d70eb678c8a33785a575b16fa7b2.tar.bz2 mv-3874b588e2a9d70eb678c8a33785a575b16fa7b2.tar.xz mv-3874b588e2a9d70eb678c8a33785a575b16fa7b2.zip |
Fix error messages about adding item to mail.
-rw-r--r-- | src/net/eathena/mail2recv.cpp | 28 | ||||
-rw-r--r-- | src/resources/notifications.h | 20 |
2 files changed, 15 insertions, 33 deletions
diff --git a/src/net/eathena/mail2recv.cpp b/src/net/eathena/mail2recv.cpp index ee9c6b6da..bb0403681 100644 --- a/src/net/eathena/mail2recv.cpp +++ b/src/net/eathena/mail2recv.cpp @@ -119,45 +119,27 @@ void Mail2Recv::processAddItemResult(Net::MessageIn &msg) if (res != 0) { - Inventory *const inv = PlayerInfo::getInventory(); - std::string itemName; - const Item *const item = inv->getItem(index); - if (item == nullptr) - { - const ItemInfo &info = ItemDB::get(itemId); - itemName = info.getName(); - } - else - { - itemName = item->getName(); - } - switch (res) { case 1: NotifyManager::notify( - NotifyTypes::MAIL_ATTACH_ITEM_WEIGHT_ERROR, - itemName); + NotifyTypes::MAIL_ATTACH_ITEM_WEIGHT_ERROR); break; case 2: NotifyManager::notify( - NotifyTypes::MAIL_ATTACH_ITEM_FATAL_ERROR, - itemName); + NotifyTypes::MAIL_ATTACH_ITEM_FATAL_ERROR); break; case 3: NotifyManager::notify( - NotifyTypes::MAIL_ATTACH_ITEM_NO_SPACE, - itemName); + NotifyTypes::MAIL_ATTACH_ITEM_NO_SPACE); break; case 4: NotifyManager::notify( - NotifyTypes::MAIL_ATTACH_ITEM_NOT_TRADEABLE, - itemName); + NotifyTypes::MAIL_ATTACH_ITEM_NOT_TRADEABLE); break; default: NotifyManager::notify( - NotifyTypes::MAIL_ATTACH_ITEM_UNKNOWN_ERROR, - itemName); + NotifyTypes::MAIL_ATTACH_ITEM_UNKNOWN_ERROR); UNIMPLEMENTEDPACKETFIELD(res); break; } diff --git a/src/resources/notifications.h b/src/resources/notifications.h index 1e25dbdb3..61d4cdb86 100644 --- a/src/resources/notifications.h +++ b/src/resources/notifications.h @@ -855,24 +855,24 @@ namespace NotifyManager NotifyFlags::STRING}, {"mail attach item weight error", // TRANSLATORS: notification message - N_("Item %s attach failed. Weight too big."), - NotifyFlags::STRING}, + N_("Item attach failed. Weight too big."), + NotifyFlags::EMPTY}, {"mail attach item fatal error", // TRANSLATORS: notification message - N_("Item %s attach failed. Fatal error."), - NotifyFlags::STRING}, + N_("Item attach failed. Fatal error."), + NotifyFlags::EMPTY}, {"mail attach item no space", // TRANSLATORS: notification message - N_("Item %s attach failed. No more space."), - NotifyFlags::STRING}, + N_("Item attach failed. No more space."), + NotifyFlags::EMPTY}, {"mail attach item non tradeable", // TRANSLATORS: notification message - N_("Item %s attach failed. Item on tradeable."), - NotifyFlags::STRING}, + N_("Item attach failed. Item on tradeable."), + NotifyFlags::EMPTY}, {"mail attach item unknown error", // TRANSLATORS: notification message - N_("Item %s attach failed. Unknown error."), - NotifyFlags::STRING}, + N_("Item attach failed. Unknown error."), + NotifyFlags::EMPTY}, {"mail remove item error", // TRANSLATORS: notification message N_("Item %s remove failed."), |