diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-07-14 22:42:47 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-07-14 22:42:47 +0300 |
commit | 26b43e7164214e8c9e5cdb8842a79a4fcc1493da (patch) | |
tree | 250a4f432ed66dee5a821eab15855cd194b18433 /src/being/playerinfo.cpp | |
parent | 21d0f7cd7b0d8474f1043ae4f283a58ea6d8b352 (diff) | |
download | plus-26b43e7164214e8c9e5cdb8842a79a4fcc1493da.tar.gz plus-26b43e7164214e8c9e5cdb8842a79a4fcc1493da.tar.bz2 plus-26b43e7164214e8c9e5cdb8842a79a4fcc1493da.tar.xz plus-26b43e7164214e8c9e5cdb8842a79a4fcc1493da.zip |
Add ability for insert cards into items.
Diffstat (limited to 'src/being/playerinfo.cpp')
-rw-r--r-- | src/being/playerinfo.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/being/playerinfo.cpp b/src/being/playerinfo.cpp index c86200219..8c7b55639 100644 --- a/src/being/playerinfo.cpp +++ b/src/being/playerinfo.cpp @@ -41,6 +41,10 @@ #include "net/mercenaryhandler.h" #include "net/playerhandler.h" +#ifdef EATHENA_SUPPORT +#include "resources/itemtype.h" +#endif + #include "utils/delete2.h" #include "debug.h" @@ -267,6 +271,18 @@ void useEquipItem(const Item *const item, const Sfx sfx) { if (item) { +#ifdef EATHENA_SUPPORT + if (item->getType() == ItemType::CARD) + { + if (mProtectedItems.find(item->getId()) == mProtectedItems.end()) + { + inventoryHandler->useCard(item); + if (sfx == Sfx_true) + ItemSoundManager::playSfx(item, ItemSoundEvent::USECARD); + } + } + else +#endif if (item->isEquipment() == Equipm_true) { if (item->isEquipped() == Equipped_true) |