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/ItemMap.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/Items/ItemMap.h') diff --git a/src/Items/ItemMap.h b/src/Items/ItemMap.h index 59fddd3fb..83ec7cbc4 100644 --- a/src/Items/ItemMap.h +++ b/src/Items/ItemMap.h @@ -7,7 +7,7 @@ -class cItemMapHandler: +class cItemMapHandler final: public cItemHandler { using Super = cItemHandler; @@ -16,12 +16,9 @@ class cItemMapHandler: public: - cItemMapHandler(): - Super(E_ITEM_MAP) - { - } + using Super::Super; - virtual void OnUpdate(cWorld * a_World, cPlayer * a_Player, const cItem & a_Item) override + virtual void OnUpdate(cWorld * a_World, cPlayer * a_Player, const cItem & a_Item) const override { cMap * Map = a_World->GetMapManager().GetMapData(static_cast(a_Item.m_ItemDamage)); -- cgit v1.2.3