From 84f1e19691aa83f0bd73d63d08de2a0baa5596bd Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 9 Oct 2014 15:27:42 +0300 Subject: eathena: add missing equip error messages. --- src/net/eathena/inventoryhandler.cpp | 18 ++++++++++++++---- src/resources/notifications.h | 4 ++++ src/resources/notifytypes.h | 1 + 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp index 7605e9177..11cc8f311 100644 --- a/src/net/eathena/inventoryhandler.cpp +++ b/src/net/eathena/inventoryhandler.cpp @@ -486,10 +486,20 @@ void InventoryHandler::processPlayerEquip(Net::MessageIn &msg) msg.readInt16("sprite"); const uint8_t flag = msg.readUInt8("result"); - if (flag) - NotifyManager::notify(NotifyTypes::EQUIP_FAILED); - else - mEquips.setEquipment(getSlot(equipType), index); + switch (flag) + { + case 0: + mEquips.setEquipment(getSlot(equipType), index); + break; + case 1: + NotifyManager::notify(NotifyTypes::EQUIP_FAILED_LEVEL); + break; + + case 2: + default: + NotifyManager::notify(NotifyTypes::EQUIP_FAILED); + break; + } BLOCK_END("InventoryHandler::processPlayerEquip") } diff --git a/src/resources/notifications.h b/src/resources/notifications.h index 05ef0f50c..0c394cea1 100644 --- a/src/resources/notifications.h +++ b/src/resources/notifications.h @@ -138,6 +138,10 @@ namespace NotifyManager // TRANSLATORS: notification message N_("Unable to equip."), NotifyFlags::EMPTY}, + {"equip failed level", + // TRANSLATORS: notification message + N_("Unable to equip because you have wrong level."), + NotifyFlags::EMPTY}, {"party create failed", // TRANSLATORS: notification message N_("Could not create party."), diff --git a/src/resources/notifytypes.h b/src/resources/notifytypes.h index e3f528e43..cb26fa5c4 100644 --- a/src/resources/notifytypes.h +++ b/src/resources/notifytypes.h @@ -54,6 +54,7 @@ namespace NotifyTypes GUILD_USER_KICKED, USE_FAILED, EQUIP_FAILED, + EQUIP_FAILED_LEVEL, PARTY_CREATE_FAILED, PARTY_CREATED, PARTY_LEFT, -- cgit v1.2.3-60-g2f50