Skip to content

Commit

Permalink
added logging
Browse files Browse the repository at this point in the history
  • Loading branch information
leoschnuell committed Nov 24, 2022
1 parent 0a45fa1 commit 73e3b0e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions game/src/backend/gamestate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ impl GameState {
}
/// Deletes all files in the directory saves, returns Ok if saves directory does not exist
pub(crate) fn delete_saves() -> RLResult {
info!("deleting saves");
let existing_files = fs::read_dir("./saves");
if existing_files.is_err() {
return Ok(());
Expand Down
3 changes: 1 addition & 2 deletions game/src/main_menu/mainmenu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ impl Screen for MainMenu {
match msg {
Exit => std::process::exit(0),
NewGame => {
fs::remove_file("./saves/autosave.yaml");
fs::remove_file("./saves/milestone.yaml");
GameState::delete_saves()?;
self.screen_sender
.send(StackCommand::Push(Box::new(GameState::new(ctx)?)))?;
}
Expand Down

0 comments on commit 73e3b0e

Please sign in to comment.