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

summaryrefslogtreecommitdiff
path: root/source/frontend/StarInventory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/frontend/StarInventory.cpp')
-rw-r--r--source/frontend/StarInventory.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/source/frontend/StarInventory.cpp b/source/frontend/StarInventory.cpp
index a7626a7..a983f3e 100644
--- a/source/frontend/StarInventory.cpp
+++ b/source/frontend/StarInventory.cpp
@@ -210,7 +210,7 @@ bool InventoryPane::giveContainerResult(ContainerResult result) {
if (!m_expectingSwap)
return false;
- for (auto item : result) {
+ for (auto& item : result) {
auto inv = m_player->inventory();
m_player->triggerPickupEvents(item);
@@ -224,18 +224,25 @@ bool InventoryPane::giveContainerResult(ContainerResult result) {
}
void InventoryPane::updateItems() {
- for (auto p : m_itemGrids)
+ for (auto& p : m_itemGrids)
p.second->updateItemState();
}
bool InventoryPane::containsNewItems() const {
- for (auto p : m_itemGrids) {
+ for (auto& p : m_itemGrids) {
if (p.second->slotsChanged())
return true;
}
return false;
}
+void InventoryPane::clearChangedSlots() {
+ for (auto& p : m_itemGrids) {
+ p.second->updateItemState();
+ p.second->clearChangedSlots();
+ }
+}
+
void InventoryPane::update(float dt) {
auto inventory = m_player->inventory();
auto context = Widget::context();