From 3bbaf83140c67e0e7c3e1729fed1354d68baf779 Mon Sep 17 00:00:00 2001 From: cha0s Date: Wed, 2 Oct 2024 14:29:44 -0500 Subject: [PATCH] fix: trading and usage when inventory open --- app/react/components/ui.jsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/react/components/ui.jsx b/app/react/components/ui.jsx index 263003b..e3bcfba 100644 --- a/app/react/components/ui.jsx +++ b/app/react/components/ui.jsx @@ -272,7 +272,12 @@ function Ui({disconnected}) { const item = entity.Inventory.item(i); newHotbarSlots.push( item - ? {icon: item.icon, qty: item.qty} + ? { + icon: item.icon, + label: item.label, + price: item.price, + qty: item.qty, + } : undefined, ); } @@ -580,6 +585,8 @@ function Ui({disconnected}) { type: 'Action', payload: {type: 'acceptTrade', value: {gaining, losing}}, }); + setGaining([]); + setLosing([]); }, [client, gaining, losing]); useEffect(() => { if (!pixiRef.current) { @@ -623,7 +630,7 @@ function Ui({disconnected}) { where, ); } - else { + else if (!isInventoryOpen) { client.send({ type: 'Action', payload: {type: 'use', value: [1, where]},