From b4aa19f329b06e42eb2591fc488b70dc0df41940 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Fri, 5 Jan 2018 11:28:06 +0000 Subject: Item durability loss now depends on the item used. (#4123) Armour durability also no longer changes when it is used to break blocks or attack mobs. Fixes #4119 --- src/Items/ItemPickaxe.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/Items/ItemPickaxe.h') diff --git a/src/Items/ItemPickaxe.h b/src/Items/ItemPickaxe.h index 66796012b..84fa655fc 100644 --- a/src/Items/ItemPickaxe.h +++ b/src/Items/ItemPickaxe.h @@ -16,6 +16,20 @@ public: } + + + virtual short GetDurabilityLossByAction(eDurabilityLostAction a_Action) override + { + switch (a_Action) + { + case dlaAttackEntity: return 2; + case dlaBreakBlock: return 1; + case dlaBreakBlockInstant: return 0; + } + } + + + char PickaxeLevel() { switch (m_ItemType) @@ -173,7 +187,3 @@ public: } } ; - - - - -- cgit v1.2.3