Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // just a simple script meant to help me easily convert the old save system to the new one.
- var key = argument0;
- var val = ds_map_find_value(obj_saveControl.saveMap, key);
- if is_undefined(val)
- {
- // THIS IS A CRITICAL FAILURE, IT SHOULD NOT HAPPEN UNLESS THE SAVE FILE IS CORRUPTED.
- show_message("CRITICAL SAVE FAILURE: Save will be deleted and game will now close.");
- if (ds_exists(obj_saveControl.saveMap, ds_type_map))
- {
- ds_map_clear(obj_saveControl.saveMap)
- ds_map_destroy(obj_saveControl.saveMap);
- }
- if (file_exists("gameSave.sav"))
- {
- file_delete("gameSave.sav");
- }
- game_end();
- return 0;
- }
- else
- {
- return val;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement