fix: trading and usage when inventory open

This commit is contained in:
cha0s 2024-10-02 14:29:44 -05:00
parent 85e252e423
commit 3bbaf83140

View File

@ -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]},