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

summaryrefslogtreecommitdiff
path: root/source/game/StarPlayerInventory.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2024-03-11 17:03:09 +1100
committerKae <80987908+Novaenia@users.noreply.github.com>2024-03-11 17:03:09 +1100
commit353406780181feffaa4836d387db4f7337ce6cce (patch)
treebeb71edbff7141af6f1b960f050b6484ec9eb758 /source/game/StarPlayerInventory.cpp
parentcaf7abebfe784a94fbc0e6b51e49cfeab91bf96a (diff)
Tile Prediction: make refunds silent
Diffstat (limited to 'source/game/StarPlayerInventory.cpp')
-rw-r--r--source/game/StarPlayerInventory.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/game/StarPlayerInventory.cpp b/source/game/StarPlayerInventory.cpp
index dc8d8e4..bacd58d 100644
--- a/source/game/StarPlayerInventory.cpp
+++ b/source/game/StarPlayerInventory.cpp
@@ -214,6 +214,14 @@ ItemPtr PlayerInventory::addItems(ItemPtr items) {
if (is<BackArmor>(items) && !backArmor())
m_equipment[EquipmentSlot::Back] = items->take(1);
+ if (is<MaterialItem>(items)) {
+ if (auto primary = primaryHeldItem()) {
+ primary->stackWith(items);
+ if (items->empty())
+ return {};
+ }
+ }
+
// Then, finally the bags
return addToBags(std::move(items));
}