From 72319b04ac6cd0877dad947e19af68dddea7b4cc Mon Sep 17 00:00:00 2001 From: Rendo Date: Wed, 17 Dec 2025 02:21:36 +0500 Subject: [PATCH] Revert "Update without restart" This reverts commit 4031e1384f396b7e9a14c18c8a2e4261d7ef848a. --- systems/auto_update.gd | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/systems/auto_update.gd b/systems/auto_update.gd index 68aa098..2b6188e 100644 --- a/systems/auto_update.gd +++ b/systems/auto_update.gd @@ -4,7 +4,6 @@ var popup_scene: PackedScene = preload("uid://5goo8fyxkv33") var new_version_avaiable: bool var popup: ConfirmationDialog -var pack_file: String signal update_version_text(to: StringName) @@ -15,9 +14,10 @@ func _ready() -> void: popup.confirmed.connect(download_button_pressed) var patch_request: HTTPRequest = popup.get_node("HTTPRequest") - var exec_dir = OS.get_executable_path().get_base_dir() - pack_file = exec_dir.path_join("chelimbalo.pck") - patch_request.download_file = pack_file + var exec_path = OS.get_executable_path() + var splitted = exec_path.split("/") + var exec_dir = exec_path.replace(splitted[len(splitted)-1],"") + patch_request.download_file = exec_dir + "chelimbalo.pck" patch_request.request_completed.connect(patch_downloaded) update_version_text.emit("Подгружаем данные с сервера...") @@ -42,7 +42,7 @@ func download_button_pressed() -> void: func patch_downloaded(result: int, _response_code: int, _headers: PackedStringArray, _body: PackedByteArray) -> void: if result == OK: - ProjectSettings.load_resource_pack(pack_file) - get_tree().reload_current_scene() + OS.create_process(OS.get_executable_path(),OS.get_cmdline_args()) + get_tree().quit() else: update_version_text.emit("[color=red]Ошибка загрузки новой версии:" + str(result) +"[/color]")