diff --git a/scripts/tools.gd b/scripts/tools.gd index 1776f557..8330cd5f 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):