From 72e33fdef5e8e847a26a5525cc64b6a198aeebd4 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Mon, 31 Jul 2023 16:41:12 +1000 Subject: [PATCH] fix last aim being held when unequipping MaterialItem while holding fire --- source/game/items/StarMaterialItem.cpp | 4 ++++ source/game/items/StarMaterialItem.hpp | 1 + 2 files changed, 5 insertions(+) diff --git a/source/game/items/StarMaterialItem.cpp b/source/game/items/StarMaterialItem.cpp index 1cc1502..c3e21f0 100644 --- a/source/game/items/StarMaterialItem.cpp +++ b/source/game/items/StarMaterialItem.cpp @@ -45,6 +45,10 @@ void MaterialItem::init(ToolUserEntity* owner, ToolHand hand) { BeamItem::init(owner, hand); } +void MaterialItem::uninit() { + m_lastAimPosition.reset(); +} + void MaterialItem::update(float dt, FireMode fireMode, bool shifting, HashSet const& moves) { FireableItem::update(dt, fireMode, shifting, moves); BeamItem::update(dt, fireMode, shifting, moves); diff --git a/source/game/items/StarMaterialItem.hpp b/source/game/items/StarMaterialItem.hpp index 5f27531..50da0fd 100644 --- a/source/game/items/StarMaterialItem.hpp +++ b/source/game/items/StarMaterialItem.hpp @@ -18,6 +18,7 @@ public: ItemPtr clone() const override; void init(ToolUserEntity* owner, ToolHand hand) override; + void uninit() override; void update(float dt, FireMode fireMode, bool shifting, HashSet const& moves) override; List nonRotatedDrawables() const override;