From d0aa7c1279dfa5489e89f76f1a66996b37e7fe81 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Sun, 20 Aug 2023 19:05:24 +1000 Subject: [PATCH] Update StarItemDrop.cpp --- source/game/StarItemDrop.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/game/StarItemDrop.cpp b/source/game/StarItemDrop.cpp index c97df6a..7b64ecc 100644 --- a/source/game/StarItemDrop.cpp +++ b/source/game/StarItemDrop.cpp @@ -263,7 +263,7 @@ void ItemDrop::update(float dt, uint64_t) { } bool ItemDrop::shouldDestroy() const { - return m_mode.get() == Mode::Dead || m_item->empty(); + return m_mode.get() == Mode::Dead || (m_item->empty() && m_mode.get() != Mode::Taken); } void ItemDrop::render(RenderCallback* renderCallback) { @@ -417,11 +417,12 @@ ItemDrop::ItemDrop() { } void ItemDrop::updateCollisionPoly() { + RectF fallback = RectF{ -0.499, -0.499, 0.499, 0.499 }; if (auto mat = as(m_item.get())) - m_boundBox = RectF{ -0.5, -0.5, 0.5, 0.5 }; + m_boundBox = fallback; else { m_boundBox = Drawable::boundBoxAll(m_item->dropDrawables(), true); - m_boundBox.rangeSetIfEmpty(RectF{ -0.5, -0.5, 0.5, 0.5 }); + m_boundBox.rangeSetIfEmpty(fallback); } MovementParameters parameters; parameters.collisionPoly = PolyF(collisionArea());