Рефактор.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user