summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-04-24 23:03:04 +0200
committerHowaner <franzi.moos@googlemail.com>2014-04-24 23:03:04 +0200
commit376dc880b37e1b104c86efebef0f294c34ca3c42 (patch)
tree269046846e0077c2f3d776f51e5c43a0d451c0a6 /src
parentFix armor in survival mode. (diff)
downloadcuberite-376dc880b37e1b104c86efebef0f294c34ca3c42.tar
cuberite-376dc880b37e1b104c86efebef0f294c34ca3c42.tar.gz
cuberite-376dc880b37e1b104c86efebef0f294c34ca3c42.tar.bz2
cuberite-376dc880b37e1b104c86efebef0f294c34ca3c42.tar.lz
cuberite-376dc880b37e1b104c86efebef0f294c34ca3c42.tar.xz
cuberite-376dc880b37e1b104c86efebef0f294c34ca3c42.tar.zst
cuberite-376dc880b37e1b104c86efebef0f294c34ca3c42.zip
Diffstat (limited to '')
-rw-r--r--src/Items/ItemHandler.cpp31
-rw-r--r--src/UI/SlotArea.cpp2
2 files changed, 26 insertions, 7 deletions
diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp
index 2cb1471aa..ce9593a70 100644
--- a/src/Items/ItemHandler.cpp
+++ b/src/Items/ItemHandler.cpp
@@ -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);
+ }
}
}
diff --git a/src/UI/SlotArea.cpp b/src/UI/SlotArea.cpp
index ef4cf17cd..87b4032e0 100644
--- a/src/UI/SlotArea.cpp
+++ b/src/UI/SlotArea.cpp
@@ -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;