} else if (child->name() == "id") { item["bodyid"] = child->value(); } else if (child->name() == "skin") { item["skin"] = child->value(); } else if (child->name() == "category") { item["categoryname"] = child->text(); } else if (child->name() == "equipped") {
if ( parent ) { processNpc( item, parent, equipment ); } } else if ( child->name() == "id" ) { item[ "bodyid" ] = child->value(); } else if ( child->name() == "skin" ) { item[ "skin" ] = child->value(); } else if ( child->name() == "category" ) { item[ "categoryname" ] = child->text(); } else if ( child->name() == "equipped" ) {
static void processNpc(QMap<QCString, QString> &item, const cElement *node, EquipmentContainer &equipment) {	// If there is an inherit tag, inherit a parent item definition.	QString inherit = node->getAttribute("inherit");	if (inherit != QString::null) {		const cElement *parent = Definitions::instance()->getDefinition(WPDT_NPC, inherit);		if (parent) {			processNpc(item, parent, equipment);		}	}	int count = node->childCount();	int i;	for (i = 0; i < count; ++i) {		const cElement *child = node->getChild(i);				// Inherit properties from another item definition		if (child->name() == "inherit") {			const cElement *parent = 0;			if (child->hasAttribute("id")) {				parent = Definitions::instance()->getDefinition(WPDT_NPC, child->getAttribute("id"));			} else {				parent = Definitions::instance()->getDefinition(WPDT_NPC, child->text());			}			 			if (parent) {				processNpc(item, parent, equipment);			}		} else if (child->name() == "id") {            item["bodyid"] = child->value();		} else if (child->name() == "skin") {			item["skin"] = child->value();		} else if (child->name() == "category") {			item["categoryname"] = child->text();		} else if (child->name() == "equipped") {			int j;			for (j = 0; j < child->childCount(); ++j) {				const cElement *subchild = child->getChild(j);				if (subchild->name() == "item") {										QString id;					if (subchild->hasAttribute("id")) {						id = subchild->getAttribute("id");					} else if (subchild->hasAttribute("list")) {						id = Definitions::instance()->getRandomListEntry(subchild->getAttribute("list"));					}					const cElement *itemNode = Definitions::instance()->getDefinition(WPDT_ITEM, id);					if (itemNode) {						QMap<QCString, QString> item;						processItem(item, itemNode);												unsigned int id = item["dispid"].toInt();						tile_st tile = TileCache::instance()->getTile(id);						if (tile.layer != 0 && tile.layer <= 0x19 && tile.animation != 0) {							item["anim"] = QString::number(tile.animation);							equipment.insert(tile.layer, item);						}					}				}			}		}	}}