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

summaryrefslogtreecommitdiff
path: root/source/frontend/StarContainerInterface.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-07-23 22:44:02 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-07-23 22:44:02 +1000
commit0aee45a1174cecca6ed4bd703ef6299185fec6b8 (patch)
treee0c7d3723406fc96e6091a28df60f490efb504e1 /source/frontend/StarContainerInterface.cpp
parent121d27446b42c960014b2e69999dad73322b05f3 (diff)
Cache certain item generation calls from interfaces
Helps a little with the lag from recipes when having crafting interfaces open, but it's still noticeable. Also micro-optimized Root maintenance by unlocking the Root mutexes for their respective shared_ptrs earlier once we have our own shared_ptr.
Diffstat (limited to 'source/frontend/StarContainerInterface.cpp')
-rw-r--r--source/frontend/StarContainerInterface.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/frontend/StarContainerInterface.cpp b/source/frontend/StarContainerInterface.cpp
index 6540dfb..d69138a 100644
--- a/source/frontend/StarContainerInterface.cpp
+++ b/source/frontend/StarContainerInterface.cpp
@@ -142,7 +142,7 @@ ContainerPane::ContainerPane(WorldClientPtr worldClient, PlayerPtr player, Conta
if (container->iconItem()) {
auto itemDatabase = Root::singleton().itemDatabase();
- auto iconItem = itemDatabase->item(container->iconItem());
+ auto iconItem = itemDatabase->itemShared(container->iconItem());
auto icon = make_shared<ItemSlotWidget>(iconItem, "/interface/inventory/portrait.png");
icon->showDurability(false);
icon->showRarity(false);