Skip to content

Commit

Permalink
Fixed Damage Out Parsing.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kraust committed Jan 2, 2025
1 parent 0adfe1c commit 710611c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion combatlog/models/combatlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def update_metadata_file(self, file, force=False):
for idx, player in enumerate(players):
handle = f"{player[1]['name']}{player[1]['handle']}"
for damage_out_player in damage_out["players"]:
if damage_out_player["name"] == handle:
if damage_out_player["name"].startswith(handle):
# Override Build with damage breakdown
players[idx][1]["build"] = self.get_build(
damage_out_player["breakdown"]
Expand Down
6 changes: 3 additions & 3 deletions combatlog/templatetags/combatlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ def summary(instance):
@register.simple_tag
def damage_out_breakdown(instance, player, handle):
"""Get the player's Damage Out Table from the metadata by their name and handle"""

if instance.damage_out is None:
return None

name = f"{player}{handle}"
for table in instance.damage_out["players"]:
if table["name"] == name:
if table["name"].startswith(name):
return table["breakdown"]
return None

0 comments on commit 710611c

Please sign in to comment.