Always convert petName to image hash in loadCustomPetData
This commit is contained in:
parent
067da33025
commit
30718988b3
1 changed files with 5 additions and 7 deletions
|
|
@ -33,13 +33,11 @@ export async function loadCustomPetData(petName) {
|
|||
// prepending "@", which is a special code that can *also* be used in the
|
||||
// CustomPetService in place of name, to get a pet's appearance from its image
|
||||
// hash.
|
||||
if (petName.match(/^[0-9]/)) {
|
||||
const imageHash = await loadImageHashFromPetName(petName);
|
||||
console.debug(
|
||||
`[loadCustomPetData] Converted pet name ${petName} to @${imageHash}`,
|
||||
);
|
||||
petName = "@" + imageHash;
|
||||
}
|
||||
const imageHash = await loadImageHashFromPetName(petName);
|
||||
console.debug(
|
||||
`[loadCustomPetData] Converted pet name ${petName} to @${imageHash}`,
|
||||
);
|
||||
petName = "@" + imageHash;
|
||||
|
||||
try {
|
||||
return neopetsAmfphpCall("CustomPetService.getViewerData", [petName]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue