Рефактор.

This commit is contained in:
sasha80
2025-05-16 14:39:25 +03:00
parent aaf1e0ee9a
commit e52341a9bc
2 changed files with 15 additions and 13 deletions

View File

@@ -35,7 +35,7 @@ func allways(val: bool, msg: String = '<не указано>'):
get_tree().quit(Error.FAILED)
func _check_index(obj, index) -> bool:
func check_index(obj, index) -> bool:
if obj is Dictionary:
if obj.has(index):
return true
@@ -59,11 +59,11 @@ func get_value_by_path(obj, paths: Array, ret_val: Array):
var index = paths.pop_at(0)
ret_val[1] = false
if paths.size():
if _check_index(obj, index):
if check_index(obj, index):
ret_val[2] += 1
get_value_by_path(obj[index], paths, ret_val)
else:
if _check_index(obj, index):
if check_index(obj, index):
ret_val[0] = obj[index]
ret_val[1] = true