fix(character): fix sheath type when mounted (#5)

This commit is contained in:
Axel Cocat 2022-03-21 00:28:13 +01:00 committed by GitHub
parent af497b7ea6
commit 91f3ec424a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 77 additions and 6 deletions

View file

@ -29,6 +29,8 @@ interface IEquipmentData {
flags: number;
enchantments: string;
randomPropertyId: number;
classId: number;
subclassId: number;
}
interface ICustomizationOption {
@ -338,7 +340,16 @@ export class CharacterController {
values: [charGuid],
timeout: this.armory.config.dbQueryTimeout,
});
return rows as RowDataPacket[] as IEquipmentData[];
const data = rows as RowDataPacket[] as IEquipmentData[];
for (const row of data) {
const item = await this.armory.dbc.item().find(item => item.id === row.itemEntry);
row.classId = item.classId;
row.subclassId = item.subclassId;
}
return data;
}
private async getMounts(realm: string, charGuid: number): Promise<IMount[]> {