fix: 2 tools showing when trying on item

This commit is contained in:
Index 2024-07-05 02:31:53 -05:00
parent cde27b8006
commit 177da6b8af

View file

@ -241,22 +241,18 @@ function TryOnItems() {
}) })
.then((data) => { .then((data) => {
data.assets.forEach((item) => { data.assets.forEach((item) => {
switch (item.type) { if (item.type !== AssetType.toLowerCase()) {
case 'hat': if (item.type === 'hat') {
Avatar.items[Avatar.items.length] = item.path || ''; Avatar.items[Avatar.items.length] = item.path || '';
break; } else if (item.type === 'face') {
case 'face':
Avatar.face = item.path || ''; Avatar.face = item.path || '';
break; } else if (item.type === 'tool') {
case 'tool':
Avatar.tool = item.path || ''; Avatar.tool = item.path || '';
break; } else if (item.type === 'shirt') {
case 'shirt':
Avatar.shirt = item.path || ''; Avatar.shirt = item.path || '';
break; } else if (item.type === 'pants') {
case 'pants':
Avatar.pants = item.path || ''; Avatar.pants = item.path || '';
break; }
} }
}); });
@ -276,7 +272,7 @@ function TryOnItems() {
return response.json(); return response.json();
}) })
.then((data) => { .then((data) => {
if (ItemType === 'tool') { if (AssetType === 'Tool') {
Avatar.tool = data.url; Avatar.tool = data.url;
} else { } else {
Avatar.items.push(data.url); Avatar.items.push(data.url);