fixed saving path for savedata

This commit is contained in:
Concedo 2025-03-17 22:19:52 +08:00
parent 0cfd8d23cb
commit ddaa8d5a38

View file

@ -2812,8 +2812,8 @@ Enter Prompt:<br>
savedata_obj.pop(str(slotid)) savedata_obj.pop(str(slotid))
saveneeded = True saveneeded = True
if saveneeded: if saveneeded:
if args.savedatafile and os.path.exists(args.savedatafile): if args.savedatafile and os.path.exists(os.path.abspath(args.savedatafile)):
with open(args.savedatafile, 'w+', encoding='utf-8', errors='ignore') as f: with open(os.path.abspath(args.savedatafile), 'w+', encoding='utf-8', errors='ignore') as f:
json.dump(savedata_obj, f) json.dump(savedata_obj, f)
print(f"Data was saved to slot {slotid}") print(f"Data was saved to slot {slotid}")
response_body = (json.dumps({"success":True, "error":""}).encode()) response_body = (json.dumps({"success":True, "error":""}).encode())