diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-08-02 12:54:15 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-08-02 12:54:15 +0000 |
commit | d5e5340c3926d1cf97f6cba151ffaecb20bfb35f (patch) | |
tree | d1faf7d5b27df8f3c523a8dd33357804118e62b1 /trunk/source/ouch.cc | |
parent | 7b2204d69f21d7075e4666ee032d7a129081bc4b (diff) | |
download | crawl-ref-d5e5340c3926d1cf97f6cba151ffaecb20bfb35f.tar.gz crawl-ref-d5e5340c3926d1cf97f6cba151ffaecb20bfb35f.zip |
Integrated travel patch as of 20060727
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'trunk/source/ouch.cc')
-rw-r--r-- | trunk/source/ouch.cc | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/trunk/source/ouch.cc b/trunk/source/ouch.cc index cda5db8667..f9a5f514dd 100644 --- a/trunk/source/ouch.cc +++ b/trunk/source/ouch.cc @@ -27,6 +27,7 @@ #include "AppHdr.h" #include <string.h> +#include <string> #include <stdio.h> #include <stdlib.h> #include <ctype.h> @@ -57,6 +58,10 @@ #include "ouch.h" +#ifdef __MINGW32__ +#include <io.h> +#endif + #include "externs.h" #include "chardump.h" @@ -546,6 +551,9 @@ void ouch( int dam, int death_source, char death_type, const char *aux ) int d = 0; int e = 0; + ait_hp_loss hpl(dam, death_type); + interrupt_activity( AI_HP_LOSS, &hpl ); + if (you.deaths_door && death_type != KILLED_BY_LAVA && death_type != KILLED_BY_WATER) { @@ -625,7 +633,7 @@ void ouch( int dam, int death_source, char death_type, const char *aux ) mpr( info, MSGCH_DIAGNOSTICS ); #endif // DEBUG_DIAGNOSTICS - if (!yesno("Die?", false)) + if (!yesno("Die?", false, 'n')) { set_hp(you.hp_max, false); return; @@ -933,9 +941,20 @@ void end_game( struct scorefile_entry &se ) // last, but not least, delete player .sav file strcpy(del_file, info); + + std::string basefile = del_file; + strcat(del_file, ".sav"); unlink(del_file); + // Delete record of stashes, kills, travel cache and lua save. + unlink( (basefile + ".st").c_str() ); + unlink( (basefile + ".kil").c_str() ); + unlink( (basefile + ".tc").c_str() ); +#ifdef CLUA_BINDINGS + unlink( (basefile + ".lua").c_str() ); +#endif + // death message if (dead) { @@ -956,7 +975,7 @@ void end_game( struct scorefile_entry &se ) } } - invent( -1, !dead ); + invent( -1, dead ); clrscr(); if (!dump_char( "morgue.txt", !dead )) |