From e507643fa0a81b6ae32df8177325aacba0b60a7d Mon Sep 17 00:00:00 2001 From: glx22 Date: Sun, 7 Apr 2024 16:47:48 +0200 Subject: [PATCH] Add: Basic range check for replace() --- nml/ast/replace.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nml/ast/replace.py b/nml/ast/replace.py index 833e1620..73f57fcd 100644 --- a/nml/ast/replace.py +++ b/nml/ast/replace.py @@ -54,6 +54,8 @@ def __init__(self, param_list, sprite_list, name, pos): def pre_process(self): self.start_id = self.start_id.reduce(global_constants.const_list) + if isinstance(self.start_id, expression.ConstantNumeric): + generic.check_range(self.start_id.value, 0, 4895 - len(self.sprite_list), "replace-block parameter 1 'start'", self.start_id.pos) def debug_print(self, indentation): generic.print_dbg(indentation, "Replace sprites starting at")