Allow creature equipments to use item.dbc entries since it's enough

This will no more allow custom items to be equiped by creatures.
Btw, since it uses client data to display them, it would not work.

Signed-off-by: Neo2003 <neo.2003@hotmail.fr>
This commit is contained in:
Neo2003 2008-12-12 20:26:27 +01:00
parent 5d4d7292b9
commit 3b753b830b

View file

@ -944,24 +944,24 @@ void ObjectMgr::LoadEquipmentTemplates()
if(!eqInfo->equipentry[j])
continue;
ItemPrototype const* proto = objmgr.GetItemPrototype(eqInfo->equipentry[j]);
ItemEntry const *dbcitem = sItemStore.LookupEntry(eqInfo->equipentry[j]);
if(!proto)
if(!dbcitem)
{
sLog.outErrorDb("Unknown item (entry=%u) in creature_equip_template.equipentry%u for entry = %u, forced to 0.", eqInfo->equipentry[j], j+1, i);
const_cast<EquipmentInfo*>(eqInfo)->equipentry[j] = 0;
continue;
}
if(proto->InventoryType != INVTYPE_WEAPON &&
proto->InventoryType != INVTYPE_SHIELD &&
proto->InventoryType != INVTYPE_RANGED &&
proto->InventoryType != INVTYPE_2HWEAPON &&
proto->InventoryType != INVTYPE_WEAPONMAINHAND &&
proto->InventoryType != INVTYPE_WEAPONOFFHAND &&
proto->InventoryType != INVTYPE_HOLDABLE &&
proto->InventoryType != INVTYPE_THROWN &&
proto->InventoryType != INVTYPE_RANGEDRIGHT)
if(dbcitem->InventoryType != INVTYPE_WEAPON &&
dbcitem->InventoryType != INVTYPE_SHIELD &&
dbcitem->InventoryType != INVTYPE_RANGED &&
dbcitem->InventoryType != INVTYPE_2HWEAPON &&
dbcitem->InventoryType != INVTYPE_WEAPONMAINHAND &&
dbcitem->InventoryType != INVTYPE_WEAPONOFFHAND &&
dbcitem->InventoryType != INVTYPE_HOLDABLE &&
dbcitem->InventoryType != INVTYPE_THROWN &&
dbcitem->InventoryType != INVTYPE_RANGEDRIGHT)
{
sLog.outErrorDb("Item (entry=%u) in creature_equip_template.equipentry%u for entry = %u is not equipable in a hand, forced to 0.", eqInfo->equipentry[j], j+1, i);
const_cast<EquipmentInfo*>(eqInfo)->equipentry[j] = 0;
@ -970,6 +970,9 @@ void ObjectMgr::LoadEquipmentTemplates()
}
sLog.outString( ">> Loaded %u equipment template", sEquipmentStorage.RecordCount );
sLog.outString();
// This DBC is currently only used for item templates and creature equipments checks.
sItemStore.Clear();
}
CreatureModelInfo const* ObjectMgr::GetCreatureModelInfo(uint32 modelid)
@ -1875,9 +1878,6 @@ void ObjectMgr::LoadItemPrototypes()
const_cast<ItemPrototype*>(proto)->FoodType = 0;
}
}
// this DBC used currently only for check item templates in DB.
sItemStore.Clear();
}
void ObjectMgr::LoadAuctionItems()