fix: 2 tools showing when trying on item
This commit is contained in:
parent
cde27b8006
commit
177da6b8af
1 changed files with 8 additions and 12 deletions
|
|
@ -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);
|
||||||
|
|
|
||||||
Reference in a new issue