From ec9413205268979909ebf8478f0cd4850a6d3f22 Mon Sep 17 00:00:00 2001 From: sasha80 Date: Mon, 10 Mar 2025 11:07:24 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0.=20=D0=9E=D1=82=D0=BB=D0=B0=D0=B4=D0=BE=D1=87?= =?UTF-8?q?=D0=BD=D0=B0=D1=8F=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D1=8F?= =?UTF-8?q?=20=D0=B2=D0=BC=D0=B5=D1=81=D1=82=D0=BE=20=D0=B2=D1=81=D1=82?= =?UTF-8?q?=D1=80=D0=BE=D0=B5=D0=BD=D0=BD=D0=BE=D0=B9=20`assert`.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/tools.gd | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/tools.gd b/scripts/tools.gd index 1776f55..8330cd5 100644 --- a/scripts/tools.gd +++ b/scripts/tools.gd @@ -29,6 +29,12 @@ func hypot(x: float, y: float) -> float: return sqrt(x * x + y * y) func is_overlap(x1, x2, y1, y2) -> bool: return max(x1, y1) <= min(x2, y2) +func allways(val: bool, msg: String = '<не указано>'): + if val: return + push_error('ошибка: %s\n' % msg) + get_tree().quit(Error.FAILED) + + func _check_index(obj, index) -> bool: if obj is Dictionary: if obj.has(index):