Add armor to switch() in ItemHandler.cpp
This commit is contained in:
parent
9cbb3a339f
commit
376dc880b3
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1108,7 +1108,7 @@ void cSlotAreaArmor::Clicked(cPlayer & a_Player, int a_SlotNum, eClickAction a_C
|
||||
return;
|
||||
}
|
||||
|
||||
//Armors haven't a dbl click
|
||||
// Armors haven't a dbl click
|
||||
if (a_ClickAction == caDblClick)
|
||||
{
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user