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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user