From 3ff57559e36d3254c64e334fbe3bdd47398fe16f Mon Sep 17 00:00:00 2001 From: x12xx12x <44411062+12xx12@users.noreply.github.com> Date: Thu, 2 Dec 2021 00:31:10 +0100 Subject: ItemHandler initialisation is a constant expression (#5344) * Transition to non-pointer item handler * That is my destructor - I decide when I leave this world * I declare your destruction private and you final --- src/Items/ItemSword.h | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'src/Items/ItemSword.h') diff --git a/src/Items/ItemSword.h b/src/Items/ItemSword.h index cb2e63c87..ddc6632e4 100644 --- a/src/Items/ItemSword.h +++ b/src/Items/ItemSword.h @@ -8,20 +8,16 @@ -class cItemSwordHandler: +class cItemSwordHandler final : public cItemHandler { using Super = cItemHandler; public: - cItemSwordHandler(int a_ItemType): - Super(a_ItemType) - { - } - + using Super::Super; - virtual bool CanHarvestBlock(BLOCKTYPE a_BlockType) override + virtual bool CanHarvestBlock(BLOCKTYPE a_BlockType) const override { if (a_BlockType == E_BLOCK_COBWEB) { @@ -31,7 +27,7 @@ public: } - virtual bool CanRepairWithRawMaterial(short a_ItemType) override + virtual bool CanRepairWithRawMaterial(short a_ItemType) const override { switch (m_ItemType) { @@ -45,7 +41,7 @@ public: } - virtual short GetDurabilityLossByAction(eDurabilityLostAction a_Action) override + virtual short GetDurabilityLossByAction(eDurabilityLostAction a_Action) const override { switch (a_Action) { @@ -58,7 +54,7 @@ public: - virtual float GetBlockBreakingStrength(BLOCKTYPE a_Block) override + virtual float GetBlockBreakingStrength(BLOCKTYPE a_Block) const override { if (a_Block == E_BLOCK_COBWEB) { -- cgit v1.2.3