summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game-server/inventory.cpp14
-rw-r--r--src/game-server/item.h2
-rw-r--r--src/game-server/itemmanager.cpp10
3 files changed, 12 insertions, 14 deletions
diff --git a/src/game-server/inventory.cpp b/src/game-server/inventory.cpp
index 41885776..75294a1c 100644
--- a/src/game-server/inventory.cpp
+++ b/src/game-server/inventory.cpp
@@ -556,7 +556,7 @@ bool Inventory::equip(int slot, bool override)
MessageOut equipMsg(GPMSG_EQUIP);
// Iterate through all possible combinations of slots
- for (ItemEquipsInfo::const_iterator it2 = eq.begin(),
+/* for (ItemEquipsInfo::const_iterator it2 = eq.begin(),
it2_end = eq.end(); it2 != it2_end; ++it2)
{
// Iterate through this combination of slots.
@@ -566,7 +566,7 @@ bool Inventory::equip(int slot, bool override)
* 2 = impossible, requires too many slots
* even with other equipment being removed
*/
- int fail = 0;
+ int fail = 0; /*
ItemEquipInfo::const_iterator it3, it3_end;
for (it3 = it2->begin(),
it3_end = it2->end();
@@ -597,7 +597,7 @@ bool Inventory::equip(int slot, bool override)
case 0:
/*
* Clean fit. Equip and apply immediately.
- */
+ */ /*
equipMsg.writeInt16(slot); // Inventory slot
equipMsg.writeInt16(it2->size()); // Equip slot type count
for (it3 = it2->begin(),
@@ -619,7 +619,7 @@ bool Inventory::equip(int slot, bool override)
/*for (unsigned int i = 0; i < it3->second; ++i)
mPoss->equipSlots.insert(
std::make_pair(it3->first, slot));*/
- }
+ /* }
updateEquipmentTrigger(0, it->second.itemId);
return true;
@@ -628,7 +628,7 @@ bool Inventory::equip(int slot, bool override)
* Definitions earlier in the item file have precedence (even if it
* means requiring unequipping more), so no need to store more
* than the first.
- */
+ */ /*
if (override && !ovd)
ovd = &*it2; // Iterator -> object -> pointer.
break;
@@ -641,7 +641,7 @@ bool Inventory::equip(int slot, bool override)
* just in case non-static equip slots do want to be
* implemented later. This would not be a trivial task,
* however.
- */
+ */ /*
LOG_WARN("Inventory - item '" << it->second.itemId <<
"' cannot be equipped, even by unequipping other items!");
break;
@@ -666,7 +666,7 @@ bool Inventory::equip(int slot, bool override)
// there is time to do so.
return false; // Return true when this section is complete
- }
+/* }
/*
* We cannot equip, either because we could not find any valid equip process
* or because we found a dirty equip and weren't allowed to override.
diff --git a/src/game-server/item.h b/src/game-server/item.h
index dbcc278c..caef386a 100644
--- a/src/game-server/item.h
+++ b/src/game-server/item.h
@@ -29,7 +29,7 @@ class Being;
class Script;
// A pair indicating: Equipment slot id -> how much slots required.
-typedef std::list< std::pair< unsigned int, unsigned int> > ItemEquipInfo;
+typedef std::pair< unsigned int, unsigned int> ItemEquipInfo;
// The list of required slots to equip.
typedef std::list< ItemEquipInfo > ItemEquipsInfo;
diff --git a/src/game-server/itemmanager.cpp b/src/game-server/itemmanager.cpp
index 2f15f005..074b8343 100644
--- a/src/game-server/itemmanager.cpp
+++ b/src/game-server/itemmanager.cpp
@@ -260,7 +260,6 @@ void ItemManager::readItemNode(xmlNodePtr itemNode)
void ItemManager::readEquipNode(xmlNodePtr equipNode, ItemClass *item)
{
- ItemEquipInfo req;
for_each_xml_child_node(subNode, equipNode)
{
if (xmlStrEqual(subNode->name, BAD_CAST "slot"))
@@ -274,24 +273,23 @@ void ItemManager::readEquipNode(xmlNodePtr equipNode, ItemClass *item)
if (utils::isNumeric(slot))
{
// When the slot id is given
- req.push_back(std::make_pair(utils::stringToInt(slot),
- XML::getProperty(subNode, "required", 1)));
+ item->mEquip.push_back(std::make_pair(utils::stringToInt(slot),
+ XML::getProperty(subNode, "required", 1)));
}
else
{
// When its name is given
- req.push_back(std::make_pair(getEquipSlotIdFromName(slot),
+ item->mEquip.push_back(std::make_pair(getEquipSlotIdFromName(slot),
XML::getProperty(subNode, "required", 1)));
}
}
}
- if (req.empty())
+ if (item->mEquip.empty())
{
LOG_WARN("Item Manager: empty equip requirement "
"definition for item " << item->getDatabaseID() << "!");
return;
}
- item->mEquip.push_back(req);
}
void ItemManager::readEffectNode(xmlNodePtr effectNode, ItemClass *item)