Advertisement
InsanelySpicyCrab

Untitled

Feb 22nd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. // just a simple script meant to help me easily convert the old save system to the new one.
  2.  
  3. var key = argument0;
  4.  
  5. var val = ds_map_find_value(obj_saveControl.saveMap, key);
  6.  
  7. if is_undefined(val)
  8. {
  9. // THIS IS A CRITICAL FAILURE, IT SHOULD NOT HAPPEN UNLESS THE SAVE FILE IS CORRUPTED.
  10. show_message("CRITICAL SAVE FAILURE: Save will be deleted and game will now close.");
  11.  
  12. if (ds_exists(obj_saveControl.saveMap, ds_type_map))
  13. {
  14. ds_map_clear(obj_saveControl.saveMap)
  15. ds_map_destroy(obj_saveControl.saveMap);
  16. }
  17.  
  18. if (file_exists("gameSave.sav"))
  19. {
  20. file_delete("gameSave.sav");
  21. }
  22.  
  23. game_end();
  24. return 0;
  25. }
  26. else
  27. {
  28. return val;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement