summaryrefslogtreecommitdiff
path: root/src/being
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-07-14 22:42:47 +0300
committerAndrei Karas <akaras@inbox.ru>2015-07-14 22:42:47 +0300
commit26b43e7164214e8c9e5cdb8842a79a4fcc1493da (patch)
tree250a4f432ed66dee5a821eab15855cd194b18433 /src/being
parent21d0f7cd7b0d8474f1043ae4f283a58ea6d8b352 (diff)
downloadmanaplus-26b43e7164214e8c9e5cdb8842a79a4fcc1493da.tar.gz
manaplus-26b43e7164214e8c9e5cdb8842a79a4fcc1493da.tar.bz2
manaplus-26b43e7164214e8c9e5cdb8842a79a4fcc1493da.tar.xz
manaplus-26b43e7164214e8c9e5cdb8842a79a4fcc1493da.zip
Add ability for insert cards into items.
Diffstat (limited to 'src/being')
-rw-r--r--src/being/playerinfo.cpp16
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)