Skip to content

Commit

Permalink
🐛 Fix TypeError parse_data in player_cards
Browse files Browse the repository at this point in the history
  • Loading branch information
omg-xtao committed Dec 29, 2024
1 parent 68da257 commit 170c272
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions modules/playercards/parse_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@ def character_parse(self, data: "Avatar") -> Optional["CharacterInfo"]:
if data.relicList:
for relic in data.relicList:
sub_affix = []
for affix in relic.subAffixList:
sub_affix.append(
SubAffixBasicInfo(
id=str(affix.affixId),
cnt=affix.cnt,
step=affix.step,
if relic.subAffixList:
for affix in relic.subAffixList:
sub_affix.append(
SubAffixBasicInfo(
id=str(affix.affixId),
cnt=affix.cnt,
step=affix.step,
)
)
)
relic_data = RelicBasicInfo(
id=str(relic.tid),
level=relic.level,
Expand All @@ -50,13 +51,14 @@ def character_parse(self, data: "Avatar") -> Optional["CharacterInfo"]:
)
relics.append(relic_data)
skill_tree_levels = []
for behavior in data.skillTreeList:
skill_tree_levels.append(
LevelInfo(
id=str(behavior.pointId),
level=behavior.level,
if data.skillTreeList:
for behavior in data.skillTreeList:
skill_tree_levels.append(
LevelInfo(
id=str(behavior.pointId),
level=behavior.level,
)
)
)
character_basic = CharacterBasicInfo(
id=str(data.avatarId),
rank=data.rank,
Expand Down

0 comments on commit 170c272

Please sign in to comment.