Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/game/StarItemDrop.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-08-20 19:05:24 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-08-20 19:05:24 +1000
commitd0aa7c1279dfa5489e89f76f1a66996b37e7fe81 (patch)
treee39fa9545f136c58949aac6b0e3550c979c4b35d /source/game/StarItemDrop.cpp
parent6e7c0498ef18ea558621eb7ca98f91122a55e6a6 (diff)
Update StarItemDrop.cpp
Diffstat (limited to 'source/game/StarItemDrop.cpp')
-rw-r--r--source/game/StarItemDrop.cpp7
1 files 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<MaterialItem>(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());