summaryrefslogtreecommitdiff
path: root/src/item.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/item.cpp')
-rw-r--r--src/item.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/item.cpp b/src/item.cpp
index 2125756a..6f04b879 100644
--- a/src/item.cpp
+++ b/src/item.cpp
@@ -1,9 +1,8 @@
/*
- * Aethyra
+ * The Mana World
* Copyright (C) 2004 The Mana World Development Team
*
- * This file is part of Aethyra based on original code
- * from The Mana World.
+ * This file is part of The Mana World.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -23,13 +22,20 @@
#include "item.h"
#include "resources/image.h"
+#include "resources/iteminfo.h"
#include "resources/resourcemanager.h"
-Item::Item(int id, int quantity, bool equipment, bool equipped):
+Item::Item(int id, int quantity, bool equipment
+#ifdef EATHENA_SUPPORT
+ , bool equipped
+#endif
+ ):
mImage(0),
mQuantity(quantity),
- mEquipment(equipment),
- mEquipped(equipped)
+ mEquipment(equipment)
+#ifdef EATHENA_SUPPORT
+ , mEquipped(equipped)
+#endif
{
setId(id);
}
@@ -44,6 +50,11 @@ void Item::setId(int id)
{
mId = id;
+#ifdef TMWSERV_SUPPORT
+ // Types 0 and 1 are not equippable items.
+ mEquipment = id && getInfo().getType() >= 2;
+#endif
+
// Load the associated image
if (mImage)
mImage->decRef();