Refactor save management; update validation logic in save_manager.gd and enhance action handling in actions.gd for improved data integrity and user experience

This commit is contained in:
Kirill
2026-09-14 07:47:21 +03:00
parent dea744bc30
commit 85a13eb241
6 changed files with 160 additions and 61 deletions
+4 -4
View File
@@ -146,10 +146,10 @@ func validate_data(data: Variant) -> String:
return "missing total_amount for " + id
if not saved.get("binds") is Dictionary or not saved.get("batches") is Dictionary:
return "state.binds and state.batches must be Dictionaries"
for owner in saved.binds:
if not saved.amount.has(owner) or not _number_map(saved.binds[owner], true):
return "invalid state.binds." + owner
for id in saved.binds[owner]:
for owner_id in saved.binds:
if not saved.amount.has(owner_id) or not _number_map(saved.binds[owner_id], true):
return "invalid state.binds." + owner_id
for id in saved.binds[owner_id]:
if not saved.amount.has(id):
return "unknown bound resource " + id
for id in saved.batches: