Skip to content

Commit

Permalink
Add -c for disable savefile check
Browse files Browse the repository at this point in the history
  • Loading branch information
dexta committed Sep 4, 2021
1 parent c249204 commit e0093ea
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions rogue/init.c
Expand Up @@ -65,6 +65,7 @@ boolean cant_int = 0;
boolean did_int = 0;
boolean score_only;
boolean have_fun;
boolean save_cheat;
boolean init_curses = 0;
boolean save_is_interactive = 1;
boolean ask_quit = 1;
Expand Down Expand Up @@ -270,6 +271,9 @@ do_args(argc, argv)
case 'f':
have_fun = 1;
break;
case 'c':
save_cheat = 1;
break;
}
}
} else {
Expand Down
1 change: 1 addition & 0 deletions rogue/rogue.h
Expand Up @@ -757,6 +757,7 @@ extern boolean r_teleport;
extern boolean save_is_interactive;
extern boolean score_only;
extern boolean have_fun;
extern boolean save_cheat;
extern boolean see_invisible;
extern boolean sustain_strength;
extern boolean trap_door;
Expand Down
4 changes: 2 additions & 2 deletions rogue/save.c
Expand Up @@ -185,7 +185,7 @@ restore(fname)
read_pack(&level_monsters, fp, 0);
read_pack(&level_objects, fp, 0);
r_read(fp, (char *) &saved_file_id, sizeof(saved_file_id));
if (new_file_id != saved_file_id) {
if ( (!save_cheat) && (new_file_id != saved_file_id) ) {
clean_up("sorry, saved game is not in the same file");
}
rw_dungeon(fp, 0);
Expand Down Expand Up @@ -221,7 +221,7 @@ restore(fname)

md_gfmt(fname, &mod_time); /* get file modification time */

if (has_been_touched(&saved_time, &mod_time)) {
if ( (!save_cheat) && (has_been_touched(&saved_time, &mod_time)) ) {
clear();
clean_up("sorry, file has been touched");
}
Expand Down

0 comments on commit e0093ea

Please sign in to comment.