Fix portable data folder reselection

This commit is contained in:
Alexander Sellite 2026-08-24 20:21:15 -04:00
parent ea4d38cb49
commit 45c903bd24
3 changed files with 39 additions and 2 deletions

View file

@ -100,7 +100,11 @@ static func migrate_active_to(
) -> Dictionary:
var normalized: String = destination.simplify_path().trim_suffix("/")
if normalized == data_root.root_path:
return {"ok": true, "message": "This data folder is already active."}
return {
"ok": true,
"changed": false,
"message": "This data folder is already active.",
}
if DirAccess.dir_exists_absolute(normalized) and not _directory_empty(normalized):
if FileAccess.file_exists(normalized.path_join(PlayerDataRoot.MANIFEST_FILENAME)):
return {
@ -163,6 +167,7 @@ static func migrate_active_to(
return {"ok": false, "message": "Migration copied data but did not change the pointer."}
return {
"ok": true,
"changed": true,
"message": "Data folder changed. Previous data was preserved.",
"previous_root": old_root,
}