🐛 修复enka更新报错

This commit is contained in:
CMHopeSunshine 2023-11-08 17:23:18 +08:00
parent eda10a1d2d
commit 84c72f713a

View File

@ -383,8 +383,8 @@ class Character(Model):
except IndexError: except IndexError:
extra_prop = None extra_prop = None
character.weapon = Weapon( character.weapon = Weapon(
name=weapon_map['Name'][weapon_c['flat']['nameTextMapHash']], name=(weapon_name := weapon_map['Name'][str(weapon_c['flat']['nameTextMapHash'])]),
type=weapon_map['Type'][weapon_map['Name'][weapon_c['flat']['nameTextMapHash']]], type=weapon_map['Type'][weapon_name],
level=weapon_c['weapon']['level'], level=weapon_c['weapon']['level'],
rarity=weapon_c['flat']['rankLevel'], rarity=weapon_c['flat']['rankLevel'],
promote_level=weapon_c['weapon']['promoteLevel'] if 'promoteLevel' in weapon_c['weapon'] else 0, promote_level=weapon_c['weapon']['promoteLevel'] if 'promoteLevel' in weapon_c['weapon'] else 0,