feat(character): hide helmet and cloak according to character flags

This commit is contained in:
Axel Cocat 2022-01-19 22:42:23 +01:00
parent 6d625929f1
commit 88e1d143d1
2 changed files with 9 additions and 2 deletions

View file

@ -65,6 +65,11 @@
};
const genders = ["male", "female"];
const hideHelm = (charData.flags & 0x0400) === 0x0400;
$("#cb-hide-helmet").prop("checked", hideHelm);
const hideCloak = (charData.flags & 0x0800) === 0x0800;
$("#cb-hide-cloak").prop("checked", hideCloak);
const characterModel = {
type: ZamModelViewer.WOW,
contentPath: "/data/",
@ -80,7 +85,7 @@
sheathOff: -1,
},
cls: charData.class,
items: charData.characterModelItems,
items: charData.characterModelItems.filter(item => !((item[0] === 1 && hideHelm) || (item[0] === 16 && hideCloak))),
models: {
type: ZamModelViewer.Wow.Types.CHARACTER,
id: `${races[charData.race]}${genders[charData.gender]}`,