diff options
author | Manoj Srivastava <srivasta@debian.org> | 2020-05-23 00:33:19 -0700 |
---|---|---|
committer | Manoj Srivastava <srivasta@debian.org> | 2020-05-23 00:33:19 -0700 |
commit | d6b913d3ca2e84b75f3675fd6e9f5246c100cf27 (patch) | |
tree | 5fc28b7efc737bf2c79dc7d799e0a6013957fe11 /src/notes.cc | |
parent | c42f029316c0c004a795ca170bdb50644a800534 (diff) | |
parent | 73a0259be1d44fdb2ab34266ae0ff63f0d8f0b60 (diff) |
Merge branch 'master' into dgit/siddebian/2.4.0-ah-1archive/debian/2.4.0-ah-1
Diffstat (limited to 'src/notes.cc')
-rw-r--r-- | src/notes.cc | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/notes.cc b/src/notes.cc index 326381c9..17990992 100644 --- a/src/notes.cc +++ b/src/notes.cc @@ -10,6 +10,7 @@ #include "notes.hpp" #include "files.hpp" +#include "game.hpp" #include "player_class.hpp" #include "player_type.hpp" #include "util.hpp" @@ -20,14 +21,14 @@ /* * Show the notes file on the screen */ -void show_notes_file(void) +void show_notes_file() { char basename[13]; char buf[1024]; char caption[10 + 13]; /* Hack -- extract first 8 characters of name and append an extension */ - (void)strnfmt(basename, sizeof(basename), "%.8s.nte", player_base); + strnfmt(basename, sizeof(basename), "%.8s.nte", game->player_base.c_str()); basename[sizeof(basename) - 1] = '\0'; /* Build the path */ @@ -37,7 +38,7 @@ void show_notes_file(void) sprintf(caption, "Note file %s", basename); /* Invoke show_file */ - (void)show_file(buf, caption, 0, 0); + show_file(buf, caption); /* Done */ return; @@ -47,14 +48,14 @@ void show_notes_file(void) * Output a string to the notes file. * This is the only function that references that file. */ -void output_note(char *final_note) +void output_note(const char *final_note) { FILE *fff; char basename[13]; char buf[1024]; /* Hack -- extract first 8 characters of name and append an extension */ - (void)strnfmt(basename, sizeof(basename), "%.8s.nte", player_base); + strnfmt(basename, sizeof(basename), "%.8s.nte", game->player_base.c_str()); basename[sizeof(basename) - 1] = '\0'; /* Build the path */ @@ -113,6 +114,8 @@ void add_note(char *note, char code) */ void add_note_type(int note_number) { + auto const &class_info = game->edit_data.class_info; + char true_long_day[50]; char buf[1024]; time_t ct = time((time_t*)0); @@ -129,9 +132,10 @@ void add_note_type(int note_number) char player[100]; /* Build the string containing the player information */ + auto const player_race_name = get_player_race_name(p_ptr->prace, p_ptr->pracem); sprintf(player, "the %s %s", - get_player_race_name(p_ptr->prace, p_ptr->pracem), + player_race_name.c_str(), class_info[p_ptr->pclass].spec[p_ptr->pspec].title); /* Add in "character start" information */ @@ -141,7 +145,7 @@ void add_note_type(int note_number) "%s %s\n" "Born on %s\n" "================================================\n", - player_name, player, true_long_day); + game->player_name.c_str(), player, true_long_day); break; } @@ -152,7 +156,7 @@ void add_note_type(int note_number) "%s slew Morgoth on %s\n" "Long live %s!\n" "================================================", - player_name, true_long_day, player_name); + game->player_name.c_str(), true_long_day, game->player_name.c_str()); break; } |