Skip to content

Commit

Permalink
improve logs errors (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
Miorey authored Jun 3, 2024
1 parent f3f587c commit ecf7670
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ scourge | 5
tauren | 6
gnome | 7
troll | 8
goblin | 9
bloodelf | 10
draenei | 11
worgen | 22
Expand Down
9 changes: 8 additions & 1 deletion character_modeling.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const NOT_DISPLAYED_SLOTS = [
]

const characterPart = () => {
return{
const ret = {
Face: `face`,
"Skin Color": `skin`,
"Hair Style": `hairStyle`,
Expand Down Expand Up @@ -43,6 +43,8 @@ const characterPart = () => {
Horns: (window.WOTLK_TO_RETAIL_DISPLAY_ID_API) ? undefined : `horns`,
"Body Size": (window.WOTLK_TO_RETAIL_DISPLAY_ID_API) ? undefined : `bodySize`
}
console.log(ret)
return ret
}


Expand Down Expand Up @@ -70,6 +72,7 @@ function optionalChaining(choice) {
*/
function getCharacterOptions(character, fullOptions) {
const options = fullOptions.Options
const missingChoice = []
const ret = []
for (const prop in characterPart()) {
const part = options.find(e => e.Name === prop)
Expand All @@ -82,8 +85,12 @@ function getCharacterOptions(character, fullOptions) {
optionId: part.Id,
choiceId: (characterPart()[prop]) ? optionalChaining(part.Choices[character[characterPart()[prop]]]) : part.Choices[0].Id
}
if(newOption.choiceId === undefined) {
missingChoice.push(characterPart()[prop])
}
ret.push(newOption)
}
console.warn(`In character: `, character, `the following options are missing`, missingChoice)

return ret
}
Expand Down

0 comments on commit ecf7670

Please sign in to comment.