| 1900 | } |
| 1901 | |
| 1902 | static bool _write_dump(const string &fname, const dump_params &par, bool quiet) |
| 1903 | { |
| 1904 | bool succeeded = false; |
| 1905 | |
| 1906 | string file_name = morgue_directory(); |
| 1907 | |
| 1908 | file_name += strip_filename_unsafe_chars(fname); |
| 1909 | |
| 1910 | StashTrack.update_corpses(); |
| 1911 | |
| 1912 | string stash_file_name; |
| 1913 | stash_file_name = file_name; |
| 1914 | stash_file_name += ".lst"; |
| 1915 | StashTrack.dump(stash_file_name.c_str(), par.full_id); |
| 1916 | |
| 1917 | file_name += ".txt"; |
| 1918 | FILE *handle = fopen_replace(file_name.c_str()); |
| 1919 | |
| 1920 | dprf("File name: %s", file_name.c_str()); |
| 1921 | |
| 1922 | if (handle != nullptr) |
| 1923 | { |
| 1924 | fputs(OUTS(par.text), handle); |
| 1925 | fclose(handle); |
| 1926 | succeeded = true; |
| 1927 | if (!quiet) |
| 1928 | #ifdef DGAMELAUNCH |
| 1929 | mpr("Char dumped successfully."); |
| 1930 | #else |
| 1931 | mprf("Char dumped to '%s'.", file_name.c_str()); |
| 1932 | #endif |
| 1933 | } |
| 1934 | else |
| 1935 | mprf(MSGCH_ERROR, "Error opening file '%s'", file_name.c_str()); |
| 1936 | |
| 1937 | return succeeded; |
| 1938 | } |
| 1939 | |
| 1940 | static int _add_text(formatted_scroller &scr, const string &tag, |
| 1941 | const string &text) |
no test coverage detected