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

summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-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());