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[]> {

View file

@ -28,6 +28,7 @@ export interface IAchievementCategory {
export interface IItemDbc {
id: number;
classId: number;
subclassId: number;
displayInfoId: number;
inventoryType: number;
}
@ -316,7 +317,7 @@ const dbcFields = {
achievement: ["id", "faction", "titleLang0", "descriptionLang0", "category", "points", "flags", "iconId"],
achievementCategory: ["id", "parent", "nameLang0"],
glyphProperties: ["id", "spellId"],
item: ["id", "classId", "displayInfoId", "inventoryType"],
item: ["id", "classId", "subclassId", "displayInfoId", "inventoryType"],
itemRetail: ["id", "inventoryType"],
itemAppearance: ["id", "itemDisplayInfoId"],
itemModifiedAppearance: ["id", "itemId", "itemAppearanceId"],