1
0

Add armor to switch() in ItemHandler.cpp

This commit is contained in:
Howaner 2014-04-24 23:03:04 +02:00
parent 9cbb3a339f
commit 376dc880b3
2 changed files with 26 additions and 7 deletions

View File

@ -91,12 +91,6 @@ cItemHandler * cItemHandler::GetItemHandler(int a_ItemType)
cItemHandler *cItemHandler::CreateItemHandler(int a_ItemType)
{
// Armor
if (ItemCategory::IsArmor(a_ItemType))
{
return new cItemArmorHandler(a_ItemType);
}
switch(a_ItemType)
{
default: return new cItemHandler(a_ItemType);
@ -229,6 +223,31 @@ cItemHandler *cItemHandler::CreateItemHandler(int a_ItemType)
{
return new cItemFoodHandler(a_ItemType);
}
// Armor:
case E_ITEM_LEATHER_CAP:
case E_ITEM_GOLD_HELMET:
case E_ITEM_CHAIN_HELMET:
case E_ITEM_IRON_HELMET:
case E_ITEM_DIAMOND_HELMET:
case E_ITEM_LEATHER_TUNIC:
case E_ITEM_GOLD_CHESTPLATE:
case E_ITEM_CHAIN_CHESTPLATE:
case E_ITEM_IRON_CHESTPLATE:
case E_ITEM_DIAMOND_CHESTPLATE:
case E_ITEM_LEATHER_PANTS:
case E_ITEM_GOLD_LEGGINGS:
case E_ITEM_CHAIN_LEGGINGS:
case E_ITEM_IRON_LEGGINGS:
case E_ITEM_DIAMOND_LEGGINGS:
case E_ITEM_LEATHER_BOOTS:
case E_ITEM_GOLD_BOOTS:
case E_ITEM_CHAIN_BOOTS:
case E_ITEM_IRON_BOOTS:
case E_ITEM_DIAMOND_BOOTS:
{
return new cItemArmorHandler(a_ItemType);
}
}
}