Skip to content

Commit f9f94b8

Browse files
authored
fixed parsing reaction conditions without parentheses (#842)
1 parent 1dc42d8 commit f9f94b8

File tree

2 files changed

+13617
-13614
lines changed

2 files changed

+13617
-13614
lines changed

data/raw_sources/srd_5_2/scripts/convert_spells_srd52.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ def parse_casting_time(casting_time: str) -> tuple[str, Optional[str]]:
3535
if "Reaction" in casting_time:
3636
# Extract reaction condition if present
3737
reaction_match = re.search(r'Reaction\s*\((.*?)\)', casting_time)
38+
# If no parentheses found, capture everything after "Reaction,"
39+
if not reaction_match:
40+
reaction_match = re.search(r'Reaction,?\s*(.*)', casting_time)
3841
if reaction_match:
3942
return "reaction", reaction_match.group(1)
4043
return "reaction", None

0 commit comments

Comments
 (0)