fix: disallows dialog blocks that aren't properly indented; however, this also changes how dialog options are parsed and will require substantial testing.

This commit is contained in:
Duncan Brown authored and Julian Murgia committed 2022-12-09 10:41:11 +01:00
1 parent 8cd61cdd2b
commit 0ff35136ba
1 file changed
+12 -2
@@ -248,8 +248,18 @@ func _compile(lines: Array, path: String = "") -> Array:
if next_line_indent > indent: if next_line_indent > indent:
dialog_option_lines.append(next_line) dialog_option_lines.append(next_line)
else: else:
lines.push_front(next_line) if _dialog_end_regex.search(next_line) or \
break _dialog_option_regex.search(next_line):
lines.push_front(next_line)
break
# There MUST be AT LEAST ONE statement/line for a dialog
# option's block that's properly indented
escoria.logger.error(
self,
"Dialog option '%s' has at least one line in its block that is not indented sufficiently." \
% line
)
if dialog_option_lines.size() > 0: if dialog_option_lines.size() > 0:
escoria.logger.trace( escoria.logger.trace(
self, self,