summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChuck Miller <shadowmil@gmail.com>2009-10-06 20:11:57 -0400
committerChuck Miller <shadowmil@gmail.com>2009-10-06 20:11:57 -0400
commitaec05fc42775374a82800980ef41c7acc7dbac1e (patch)
treefea5892ff0820e19cea5eb65921bb2f93a31c08a
parent111d846d6dd9335a59860618c5362a2562d28d5c (diff)
downloadmana-aec05fc42775374a82800980ef41c7acc7dbac1e.tar.gz
mana-aec05fc42775374a82800980ef41c7acc7dbac1e.tar.bz2
mana-aec05fc42775374a82800980ef41c7acc7dbac1e.tar.xz
mana-aec05fc42775374a82800980ef41c7acc7dbac1e.zip
Fixes equipment for players
-rw-r--r--src/localplayer.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 14f85bfe..727b067b 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -63,6 +63,7 @@
#include "resources/animation.h"
#include "resources/imageset.h"
+#include "resources/itemdb.h"
#include "resources/iteminfo.h"
#include "resources/resourcemanager.h"
@@ -331,7 +332,11 @@ void LocalPlayer::clearInventory()
void LocalPlayer::setInvItem(int index, int id, int amount)
{
- mInventory->setItem(index, id, amount);
+ bool equipment = false;
+ int itemType = ItemDB::get(id).getType();
+ if (itemType != ITEM_UNUSABLE && itemType != ITEM_USABLE)
+ equipment = true;
+ mInventory->setItem(index, id, amount, equipment);
}
#endif