Skip to content

Commit c20656f

Browse files
committed
Fixed bug with death with a single killer with "and" in the name
1 parent deccc4d commit c20656f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tibiapy/character.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ def _parse_deaths(self, rows):
558558
break
559559
death_time_str = cols[0].text.replace("\xa0", " ").strip()
560560
death_time = parse_tibia_datetime(death_time_str)
561-
death = str(cols[1]).replace("\xa0", " ")
561+
death = str(cols[1])
562562
death_info = death_regexp.search(death)
563563
if death_info:
564564
level = int(death_info.group("level"))
@@ -577,6 +577,7 @@ def _parse_deaths(self, rows):
577577
assists_name_list = link_search.findall(assists_desc)
578578
killers_name_list = split_list(killers_desc)
579579
for killer in killers_name_list:
580+
killer = killer.replace("\xa0", " ")
580581
killer_dict = self._parse_killer(killer)
581582
death.killers.append(Killer(**killer_dict))
582583
for assist in assists_name_list:
@@ -628,7 +629,8 @@ def _parse_killer(cls, killer):
628629
"""
629630
# If the killer contains a link, it is a player.
630631
if "href" in killer:
631-
killer_dict = {"name": link_content.search(killer).group(1), "player": True}
632+
m = link_content.search(killer)
633+
killer_dict = {"name": m.group(1), "player": True}
632634
else:
633635
killer_dict = {"name": killer, "player": False}
634636
# Check if it contains a summon.

0 commit comments

Comments
 (0)