DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T p

⟦6014f203f⟧ TextFile

    Length: 60251 (0xeb5b)
    Types: TextFile
    Names: »patches04«

Derivation

└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987
    └─⟦this⟧ »EUUGD18/General/Umoria/patches04« 

TextFile

*** oldmoria/INSTALL	Sun Oct 30 01:18:12 1988
--- newmoria/INSTALL	Sun Oct 30 01:07:29 1988
***************
*** 23,26 ****
--- 23,32 ----
  define NO_SIGNED_CHARS in config.h.
  
+ By default, scores from panic saved games are not stored into the
+ scoreboard.  Some sites have a lot of trouble with HANGUP signals though.
+ If so, you can allow scores of panic saved games to be recorded by defining
+ SCORE_PANIC_SAVES.  This is not recommended, as it enables some rather
+ devious cheating methods.
+ 
  Moria may not compile properly on SYS III machines(?)
  
*** oldmoria/Int16bit.patch	Sun Oct 30 01:17:48 1988
--- newmoria/Int16bit.patch	Sun Oct 30 01:08:00 1988
***************
*** 393,397 ****
    {
      register int i;
!     register int mask = 0x1;
    
  !   for (i = 0; i < sizeof(int)*8; i++) {
--- 393,397 ----
    {
      register int i;
! !    register int mask = 0x1;
    
  !   for (i = 0; i < sizeof(int)*8; i++) {
***************
*** 406,410 ****
    {
      register int i;
!     register int mask = 0x1;
    
  !   for (i = 0; i < sizeof(*test)*8; i++) {
--- 406,410 ----
    {
      register int i;
! !   bitset_t mask = 0x1;
    
  !   for (i = 0; i < sizeof(*test)*8; i++) {
***************
*** 500,504 ****
      int new_spell;
      int test_array[32];
! !   bitset_t int spell_flag;
      int learn;
      register spell_type *s_ptr;
--- 500,504 ----
      int new_spell;
      int test_array[32];
! !   bitset_t spell_flag;
      int learn;
      register spell_type *s_ptr;
*** oldmoria/Moria_news	Sun Oct 30 01:16:40 1988
--- newmoria/Moria_news	Sun Oct 30 01:07:31 1988
***************
*** 9,13 ****
  UNIX Port : James E. Wilson    / UC Berkeley
  
- This is a beta release of umoria 4.87
- 
  Dungeon Master: This file may contain updates and news.
--- 9,11 ----
*** oldmoria/PROBLEMS	Sun Oct 30 01:17:44 1988
--- newmoria/PROBLEMS	Sun Oct 30 01:07:32 1988
***************
*** 466,469 ****
--- 466,527 ----
  many files: change move_char(5) to move_light(char_row, char_col, char_row,
  	char_col), avoid problems with potential recursive calls to move_char()
+ sent out u487.p3 patch file
+ --------------------- 7/6
+ Int16bit.patch: change "bitset_t int" to "bitset_t"
+ config.h: NO_SIGNED_CHARS was missing trailing */
+ Moria_news: delete beta release comment
+ --------------------- 7/8
+ spells.c: fixed poly_monster, only worked when next to monster
+ --------------------- 8/9
+ save.c: printing of version changed from %lf to %.2lf
+ config.h: eliminated comment about dynix not needing BUGGY_CURSES
+ --------------------- 8/13
+ Int16bit.patch: mask in bit_pos() in misc1.c should be bitset_t, not int
+ --------------------- 8/15
+ misc2.c,spells.c: changed array decl for function parameters (e.g. vtype)
+ 	to pointers (e.g. char *)
+ --------------------- 8/24
+ help.c: change char for original mode shell_out command from $ to !
+ files.c: null terminate dun_line in after inner_loop; make filename, page_width
+ 	 and page_height static to remember new default values
+ save.c: change references of st_atime to st_mtime, prevent automatic backup
+ 	programs from corrupting save files
+ -------------------- 9/21
+ creature.c: for drain charge attack (24), only succeed if there is comething
+ 	in the player's inventory
+ --------------------- 9/30
+ moria1.c: missing 'int' keyword added back in
+ --------------------- 10/10
+ moria1.c: sub3_move_light, change order of declarations since it caused a
+ 	problem on a 3B2
+ types.h: spl_type declared as array of 22 when should have been array of 32
+ ---------------------- 10/17
+ externs.h: t_level declared incorrectly
+ ---------------------- 10/29
+ *.c: fix all uses of divide operator, eliminate unnecessary floating point
+ 	operations, distinguish between round() and trunc()/div in VMS source
+ monsters.c: changed invisible stalker from 'E' to 'I'
+ spells.c: fixed td_destroy, so that when it destroys trap on chest, it also changes
+ 	name of chest to reflect this
+ moria2.c, spells.c: eliminated first extraneous space in " (Empty)" etc. strings
+ scrolls.c: fixed dangling pointer bug, was calling inven_destroy, and then using
+ 	pointer to destroyed object
+ files.c, death.c: add name of score file to "can't open" error messages
+ moria2.c: examine_book does not work if blind/no light/confused
+ treasure1.c, treasure2.c: add plurals to magic books, and pints of ale/wine
+ io.c: panic save if read EOF from stdin
+ main.c, save.c, signals.c: only panic save if character generation is complete,
+ 	eliminated variable generate
+ signals.c: flush input in control-C handler, move put_qio so "y/n?" message erased
+ dungeon.c: ^A (0) no longer asks if you want to quit, can be returned by an
+ 	interrupted getchar call
+ moria1.c: area_affect does not need to test find_flag, it is always true
+ treasure1.c: change potion of water to "crystal clear", so no conflict with 
+ 	randomly named potions
+ config.h, death.c, save.c: added option SCORE_PANIC_SAVES for those who
+ 	find the non-scoring panic_save feature annoying
+ store2.c: add asterisk to call through function pointer, some compilers need this
+ constants.h, README, wizard.c: update patch level to 4, create PATCHLEVEL
+ 	define and print it out with version command
  
  Working on:
***************
*** 480,507 ****
  
  Things to be fixed:
! 
! check plurals "~" in object names, esp. Pint in treasure2.c
! make get_panel run stops user customizable?
! objects in outside corners do not stop run
! moria1.c: area_affect does not need to check "if (find_flag)"
! carefully check everyplace that clears find_flag, there are a lot
! 	of unnecessary checks, perhaps even some recursive calls to move_char
! check setting of moria_flag in dungeon.c, esp. after restore_char ()
  add "moria ^file" option to automatically do wizard restore,
     do the umask calls in the program instead of forcing user to type them
! don't ask for quit on char '\0', should instead ignore it
! check for EOF when reading characters
! complaint that a hangup (kill -1) results in a game whose
! 	score will no longer be posted to the scoreboard
! resting should have small but finite chance of waking a monster
!   perhaps check once every 10 turns against randint(6) > stealth
! cursor should be positioned somewhere before each inkey call
  all npc spells should print descriptive message
  allow rerolling after choose race/class
! remove "clear" from random potion names?
  pad should take a char not a string
- print a number with the repeat_msg command
  Message line overextending into second line should be erased
! identify staffs/wands as having zero charges, when they run out
  ``can't carry that much weight'' before ``that many items'' is wrong?
     I like it the way it is now, though
--- 538,582 ----
  
  Things to be fixed:
! suspend handler should save/restore local special characters,
! 	need routine to surround or replace suspend_handdler()
! these commands which take a dir should not work when confused,
!    bash, tunnel, closeobject, jamdoor, openobject
  add "moria ^file" option to automatically do wizard restore,
     do the umask calls in the program instead of forcing user to type them
! some armor have negative to-hit values, should this be part of the name?
!    mention this in the Moria.doc file
! add a pull-back map command like the PC version, display entire map on screen
!    only showing important features, like stairs
! apply the new.16bit.patches to create a new Int16bit.patch file
! identify staffs/wands as having zero charges, when they run out
! list of spell books not cleared when get cast which spell? prompt
! wielding heavy wepaons, fix + to hit on screen?
! 	ptho subtracted in attak_blows() misc2.c, could probably subtract
! 	these point in moria1.c py_bonuses(), when calculate dis_th
! should one really be able to find a chest inside of another chest??
! received report that someone once lost a light source because of the 
! 	wield/wear command, I don't see anything wrong though
! trap names are vague,
!    have two names for each trap, a simple search discloses current vague name,
!    setting it off, or a find/identify trap gives the long name
! use of reset_flag for free moves still a little inconsistent
! 	commands that only use objects in backpack (use,aim,quaff,eat,read_scroll,
! 		pray,cast,etc.) are free move if no action taken,
! 	other commands (bash,openobject,closeobject,jamdoor,etc.) always use move
! 		even if no action taken
! problems with mass polymorph wand?  I once ended up surrounded by
!   non existant mushrooms after many zaps.  I think it is a race, i.e.
!   scans monster list while adding and deleting elements.
!   - this can also while cloning cubes
!   - also, when compact_monsters deletes a monster, it does not update screen
! add scorefile editing functions, perhaps just have an ascii score file?
! should low level monsters be able to eat high level monsters?
! objects in outside corners do not stop run
  all npc spells should print descriptive message
  allow rerolling after choose race/class
! cursor should be positioned somewhere before each inkey call
  pad should take a char not a string
  Message line overextending into second line should be erased
! print a number with the repeat_msg command
  ``can't carry that much weight'' before ``that many items'' is wrong?
     I like it the way it is now, though
***************
*** 509,512 ****
--- 584,589 ----
  	perhaps use only motion optimization stuff?
  Dot tunneling command
+ resting should have small but finite chance of waking a monster
+   perhaps check once every 10 turns against randint(6) > stealth
  encrypt info before writing it to the save file
     perhaps xor with stat buffer
***************
*** 517,522 ****
  	of the vault_trap bug fixed 4/6
  subval, missile_ctr could be short ints
- note that some armor can decrease to-hit values in docs,
- 	should these be displayed in name?
  missing amulets, 1-4 strength, constitution, intelligence, dexterity
  missing rings 5-6 gain wisdom, gain charisma
--- 594,597 ----
***************
*** 529,533 ****
  	perhaps some ifdefed code which does no-blocking I/O for them?
  add death due to starvation
- wielding heavy wepaons, fix + to hit on screen?
  don't let dragons breathe on first attack, AMHD is nasty
  	especially after the screen changes to the next panel
--- 604,607 ----
***************
*** 534,538 ****
  checking both ((!m_ptr->ml) or (!see_invis && mon invis)) is probably
  	redundant when determining whether or not player can see a monster
- list of spell books not cleared when get cast which spell? prompt
  should we call m_name if spell only applies to visible creatures?
  many spells do not print desciptive comment, aggravate_monster for instance
--- 608,611 ----
***************
*** 562,567 ****
  in general, loss of an ability should have many affects, non of which are 
  	implemented, for example, lose of intelligence should cause a mage
! 	to lose spells
! cases of permanent slowness reported?
  add user name to scoreboard?
  also add points and experience to scoreboard
--- 635,640 ----
  in general, loss of an ability should have many affects, non of which are 
  	implemented, for example, lose of intelligence should cause a mage
! 	to lose spells, gain of int should cause mage to learn spells
! cases of permanent slowness reported, why does this happen?
  add user name to scoreboard?
  also add points and experience to scoreboard
***************
*** 570,574 ****
  change turn to a long
  store_open should be a long
- use of reset_flag for free moves still a little inconsistent
  fix save files to include obj desc, then only need one random number
  	generator which can use table program
--- 643,646 ----
***************
*** 575,582 ****
  replace magic numbers with constants
  name objects if use did not identify them
  
- add a pull-back map command like the PC version, display entire map on screen
-    only showing important features, like stairs
- 
  Very Hard things to add:
  recenter character on screen?
--- 647,654 ----
  replace magic numbers with constants
  name objects if use did not identify them
+ light spells should work in corridors, what they light should be permanent
+ creeping coins should leaves coins as treasure
+ when creature steals and then dies, the stolen item should appear
  
  Very Hard things to add:
  recenter character on screen?
***************
*** 588,593 ****
--- 660,667 ----
  'flavor' the levels, dragons on one level, undead on another, etc.
  what's been discovered list
+ make get_panel run stops user customizable? via environment variable
  use environment variables to specify rogue-like/original keys
  use environment variable for default save file
+ use environment variables for files.c: page_height,page_width, filename
  add option to restore files from default save filename
  commands not close enough to rogue style
*** oldmoria/README	Sun Oct 30 01:16:34 1988
--- newmoria/README	Sun Oct 30 01:07:32 1988
***************
*** 1,4 ****
  
! This copy of umoria includes the first three patch files (upto u487.p3).
  
  Please report problems to wilson@ji.Berkeley.EDU  (ucbvax!ucbji!wilson).
--- 1,4 ----
  
! This copy of 4.87 umoria includes the first four patch files (upto u487.p4).
  
  Please report problems to wilson@ji.Berkeley.EDU  (ucbvax!ucbji!wilson).
*** oldmoria/config.h	Sun Oct 30 01:16:45 1988
--- newmoria/config.h	Sun Oct 30 01:07:32 1988
***************
*** 38,43 ****
  /* if the screen does not look right (it will be obvious) then you have a buggy
     version of curses, and you must define this */
! /* this must be defined for Ultrix systems, and for most 4.2BSD systems
!    it is not needed for Dynix */
  /* only need to recompile io.c */
  /* #define BUGGY_CURSES */
--- 38,42 ----
  /* if the screen does not look right (it will be obvious) then you have a buggy
     version of curses, and you must define this */
! /* this must be defined for Ultrix systems, and for most 4.2BSD systems */
  /* only need to recompile io.c */
  /* #define BUGGY_CURSES */
***************
*** 45,49 ****
  /* define this is your machine does not have signed characters:
     this is needed for IBM PC-RT, 3B1, 3B2, 3B20, and perhaps others */
! /* #define NO_SIGNED_CHARS
  
  /* this will slow down the game a bit, and therefore make it use up a little
--- 44,48 ----
  /* define this is your machine does not have signed characters:
     this is needed for IBM PC-RT, 3B1, 3B2, 3B20, and perhaps others */
! /* #define NO_SIGNED_CHARS */
  
  /* this will slow down the game a bit, and therefore make it use up a little
***************
*** 52,55 ****
--- 51,61 ----
  /* only need to recompile dungeon.c and create.c
  /* #define SLOW */
+ 
+ /* if this is defined, scores from panic save files will be added to the
+    scoreboard, this is not recommended because it enables several rather
+    devious cheating methods, however, it is useful on systems where HANGUP
+    signals are common (i.e. lots of dialup users, unreliable terminal
+    multiplexors, etc.) */
+ /* #define SCORE_PANIC_SAVES */
  
  /* system dependent defines follow, you should not need to change anything
*** oldmoria/constants.h	Sun Oct 30 01:18:04 1988
--- newmoria/constants.h	Sun Oct 30 01:07:33 1988
***************
*** 10,13 ****
--- 10,14 ----
  /* Current version number of Moria				*/
  #define CUR_VERSION 4.87
+ #define PATCH_LEVEL 4
  
  #ifndef TRUE
*** oldmoria/creature.c	Sun Oct 30 01:17:37 1988
--- newmoria/creature.c	Sun Oct 30 01:07:34 1988
***************
*** 423,427 ****
  	case 24:      /*Eat charges       */
  	  if (test_hit(15, (int)c_ptr->level, 0, p_ptr->pac+p_ptr->ptoac))
! 	    flag = TRUE;
  	  break;
  	case 99:
--- 423,428 ----
  	case 24:      /*Eat charges       */
  	  if (test_hit(15, (int)c_ptr->level, 0, p_ptr->pac+p_ptr->ptoac))
! 	    if (inven_ctr > 0)  /* check to make sure an object exists */
! 	      flag = TRUE;
  	  break;
  	case 99:
***************
*** 1171,1175 ****
  	  (void) strcat(cdesc, "breathes lightning.");
  	  msg_print(cdesc);
! 	  breath(1, char_row, char_col, (int)(m_ptr->hp/4.0), ddesc);
  	  break;
  	case 21:  /*Breath Gas   */
--- 1172,1176 ----
  	  (void) strcat(cdesc, "breathes lightning.");
  	  msg_print(cdesc);
! 	  breath(1, char_row, char_col, (m_ptr->hp / 4), ddesc);
  	  break;
  	case 21:  /*Breath Gas   */
***************
*** 1176,1180 ****
  	  (void) strcat(cdesc, "breathes gas.");
  	  msg_print(cdesc);
! 	  breath(2, char_row, char_col, (int)(m_ptr->hp/3.0), ddesc);
  	  break;
  	case 22:  /*Breath Acid  */
--- 1177,1181 ----
  	  (void) strcat(cdesc, "breathes gas.");
  	  msg_print(cdesc);
! 	  breath(2, char_row, char_col, (m_ptr->hp / 3), ddesc);
  	  break;
  	case 22:  /*Breath Acid  */
***************
*** 1181,1185 ****
  	  (void) strcat(cdesc, "breathes acid.");
  	  msg_print(cdesc);
! 	  breath(3, char_row, char_col, (int)(m_ptr->hp/3.0), ddesc);
  	  break;
  	case 23:  /*Breath Frost */
--- 1182,1186 ----
  	  (void) strcat(cdesc, "breathes acid.");
  	  msg_print(cdesc);
! 	  breath(3, char_row, char_col, (m_ptr->hp / 3), ddesc);
  	  break;
  	case 23:  /*Breath Frost */
***************
*** 1186,1190 ****
  	  (void) strcat(cdesc, "breathes frost.");
  	  msg_print(cdesc);
! 	  breath(4, char_row, char_col, (int)(m_ptr->hp/3.0), ddesc);
  	  break;
  	case 24:  /*Breath Fire  */
--- 1187,1191 ----
  	  (void) strcat(cdesc, "breathes frost.");
  	  msg_print(cdesc);
! 	  breath(4, char_row, char_col, (m_ptr->hp / 3), ddesc);
  	  break;
  	case 24:  /*Breath Fire  */
***************
*** 1191,1195 ****
  	  (void) strcat(cdesc, "breathes fire.");
  	  msg_print(cdesc);
! 	  breath(5, char_row, char_col, (int)(m_ptr->hp/3.0), ddesc);
  	  break;
  	default:
--- 1192,1196 ----
  	  (void) strcat(cdesc, "breathes fire.");
  	  msg_print(cdesc);
! 	  breath(5, char_row, char_col, (m_ptr->hp / 3), ddesc);
  	  break;
  	default:
***************
*** 1350,1354 ****
  		      else if (py.flags.rest < 1)
  			if (randint(10) > py.misc.stl)
! 			  m_ptr->csleep -= (75.0/m_ptr->cdis);
  		    if (m_ptr->stunned > 0)
  		      m_ptr->stunned--;
--- 1351,1355 ----
  		      else if (py.flags.rest < 1)
  			if (randint(10) > py.misc.stl)
! 			  m_ptr->csleep -= (75 / m_ptr->cdis);
  		    if (m_ptr->stunned > 0)
  		      m_ptr->stunned--;
*** oldmoria/death.c	Sun Oct 30 01:18:05 1988
--- newmoria/death.c	Sun Oct 30 01:07:35 1988
***************
*** 133,140 ****
    high_scores score;
    char list[20][256];
  
    if (1 > (fd = open(MORIA_TOP, O_RDONLY, 0644)))
      {
!       prt("Error opening top twenty file\n", 0, 0);
        return ;
      }
--- 133,142 ----
    high_scores score;
    char list[20][256];
+   char string[100];
  
    if (1 > (fd = open(MORIA_TOP, O_RDONLY, 0644)))
      {
!       sprintf (string, "Error opening score file \"%s\"\n", MORIA_TOP);
!       prt(string, 0, 0);
        return ;
      }
***************
*** 267,270 ****
--- 269,273 ----
      exit_game();
  
+ #ifndef SCORE_PANIC_SAVES
    if (panic_save == 1)
      {
***************
*** 275,278 ****
--- 278,282 ----
        exit_game();
      }
+ #endif
  
    myscore.points = (long)total_points();
*** oldmoria/dungeon.c	Sun Oct 30 01:17:26 1988
--- newmoria/dungeon.c	Sun Oct 30 01:07:53 1988
***************
*** 704,708 ****
  		if (randint(100) == 1)
  		  {
! 		    find_flag = FALSE; /* no need for move_char(5) */
  		    teleport(40);
  		  }
--- 704,708 ----
  		if (randint(100) == 1)
  		  {
! 		    find_flag = FALSE;   /* no need for move_char(5) */
  		    teleport(40);
  		  }
***************
*** 753,757 ****
    switch(*com_val)
      {
!     case 0: case 11:		/*^K == exit    */
        flush();
        if (get_com("Enter 'Q' to quit", &command))
--- 753,757 ----
    switch(*com_val)
      {
!     case 11:				/*^K == exit    */
        flush();
        if (get_com("Enter 'Q' to quit", &command))
***************
*** 1084,1087 ****
--- 1084,1089 ----
  	      restore_char();                   /*^V == restore */
  	      prt_stat_block();
+ 	      /* force generation of new level, in case there is something wrong
+ 		 with the old one */
  	      moria_flag = TRUE;
  	      break;
***************
*** 1147,1151 ****
    switch(*com_val)
      {
!     case 0: case 'Q':		/*Q == exit    */
        flush();
        if (get_com("Do you really want to quit?", &command))
--- 1149,1153 ----
    switch(*com_val)
      {
!     case 'Q':				/*Q == exit    */
        flush();
        if (get_com("Do you really want to quit?", &command))
***************
*** 1566,1569 ****
--- 1568,1573 ----
  	      restore_char();                   /*^V == restore */
  	      prt_stat_block();
+ 	      /* force generation of new level, in case there is something wrong
+ 		 with the old one */
  	      moria_flag = TRUE;
  	      break;
*** oldmoria/eat.c	Sun Oct 30 01:18:14 1988
--- newmoria/eat.c	Sun Oct 30 01:07:35 1988
***************
*** 210,214 ****
  		{
  		  m_ptr = &py.misc;
! 		  m_ptr->exp += ((i_ptr->level/m_ptr->lev) + .5);
  		  prt_experience();
  		}
--- 210,214 ----
  		{
  		  m_ptr = &py.misc;
! 		  m_ptr->exp += (((float) i_ptr->level / (float) m_ptr->lev) + 0.5);
  		  prt_experience();
  		}
*** oldmoria/externs.h	Sun Oct 30 01:18:15 1988
--- newmoria/externs.h	Sun Oct 30 01:07:42 1988
***************
*** 12,16 ****
  extern int missile_ctr;	/* Counter for missiles */
  extern int msg_flag;	/* Set with first msg  */
- extern int generate;	/* Generate next level */
  extern int death;	/* True if died	      */
  extern vtype died_from;	/* What killed him     */
--- 12,15 ----
***************
*** 93,97 ****
  extern treasure_type object_list[MAX_OBJECTS];
  extern int object_ident[MAX_OBJECTS];
! extern int t_level[MAX_OBJ_LEVEL];
  extern treasure_type gold_list[MAX_GOLD];
  extern treasure_type t_list[MAX_TALLOC];
--- 92,96 ----
  extern treasure_type object_list[MAX_OBJECTS];
  extern int object_ident[MAX_OBJECTS];
! extern int t_level[MAX_OBJ_LEVEL+1];
  extern treasure_type gold_list[MAX_GOLD];
  extern treasure_type t_list[MAX_TALLOC];
*** oldmoria/files.c	Sun Oct 30 01:18:00 1988
--- newmoria/files.c	Sun Oct 30 01:07:36 1988
***************
*** 33,37 ****
    if (1 > (highscore_fd = open(MORIA_TOP, O_RDWR | O_CREAT, 0644)))
      {
!       (void) fputs("Can't open score file!\n", stderr);
        exit(1);
      }
--- 33,37 ----
    if (1 > (highscore_fd = open(MORIA_TOP, O_RDWR | O_CREAT, 0644)))
      {
!       (void) fprintf (stderr, "Can't open score file \"%s\"\n", MORIA_TOP);
        exit(1);
      }
***************
*** 120,138 ****
    register k, l;
    register i7, i8;
!   char dun_line[MAX_WIDTH];
    char *dun_ptr;
!   vtype filename1;
    char tmp_str[80];
    FILE *file1;
!   int page_width = OUTPAGE_WIDTH;
!   int page_height = OUTPAGE_HEIGHT;
  
    /* this allows us to strcat each character in the inner loop,
       instead of using the expensive sprintf */
!   prt("File name: ", 0, 0);
!   if (get_string(filename1, 0, 11, 64))
      {
!       if (strlen(filename1) == 0)
! 	(void) strcpy(filename1, "MORIAMAP.DAT");
        if ((file1 = fopen(filename1, "w")) == NULL)
  	{
--- 120,140 ----
    register k, l;
    register i7, i8;
!   char dun_line[MAX_WIDTH+1];
    char *dun_ptr;
!   static vtype filename1 = "MORIAMAP.DAT";
!   vtype filename2;
    char tmp_str[80];
    FILE *file1;
!   static int page_width = OUTPAGE_WIDTH;
!   static int page_height = OUTPAGE_HEIGHT;
  
    /* this allows us to strcat each character in the inner loop,
       instead of using the expensive sprintf */
!   (void) sprintf (tmp_str, "File name [%s]: ", filename1);
!   prt(tmp_str, 0, 0);
!   if (get_string(filename2, 0, strlen(tmp_str), 64))
      {
!       if (strlen(filename2) > 0)
! 	(void) strcpy(filename1, filename2);
        if ((file1 = fopen(filename1, "w")) == NULL)
  	{
***************
*** 209,212 ****
--- 211,215 ----
  		    }
  		  *dun_ptr++ = '\n';
+ 		  *dun_ptr++ = '\0';
  		  (void) fputs(dun_line, file1);
  		}
*** oldmoria/generate.c	Sun Oct 30 01:17:53 1988
--- newmoria/generate.c	Sun Oct 30 01:07:37 1988
***************
*** 140,145 ****
  
    /* Choose starting point and direction		*/
!   y = (cur_height/2.0) + 11 - randint(23);
!   x = (cur_width/2.0)  + 16 - randint(33);
  
    dir = randint(8);	/* Number 1-4, 6-9	*/
--- 140,145 ----
  
    /* Choose starting point and direction		*/
!   y = (cur_height / 2) + 11 - randint(23);
!   x = (cur_width / 2)  + 16 - randint(33);
  
    dir = randint(8);	/* Number 1-4, 6-9	*/
*** oldmoria/help.c	Sun Oct 30 01:17:33 1988
--- newmoria/help.c	Sun Oct 30 01:07:38 1988
***************
*** 133,137 ****
    prt("e       Equipment list.       |  ^X       Save character and quit.",
        14, 0);
!   prt("f       Fire/Throw an item.   |   $       Shell out of game.", 15, 0);
  /*  prt("h       Help on key commands. |", 16, 0); */
    prt("i       Inventory list.       |  < Go up an up-staircase.", 17, 0);
--- 133,137 ----
    prt("e       Equipment list.       |  ^X       Save character and quit.",
        14, 0);
!   prt("f       Fire/Throw an item.   |   !       Shell out of game.", 15, 0);
  /*  prt("h       Help on key commands. |", 16, 0); */
    prt("i       Inventory list.       |  < Go up an up-staircase.", 17, 0);
*** oldmoria/io.c	Sun Oct 30 01:17:17 1988
--- newmoria/io.c	Sun Oct 30 01:07:38 1988
***************
*** 3,6 ****
--- 3,7 ----
  #include <sys/ioctl.h>
  #include <sys/file.h>
+ #include <signal.h>
  
  #include "constants.h"
***************
*** 231,236 ****
  char *ch;
  {
    put_qio();			/* Dump IO buffer		*/
!   *ch = getch();
    msg_flag = FALSE;
  }
--- 232,251 ----
  char *ch;
  {
+   int i;
+ 
    put_qio();			/* Dump IO buffer		*/
!   i = getch();
!   if ((i == EOF) && (feof (stdin)))
!     {
!       prt ("Read end of file!!!!!", 22, 0);
!       refresh ();
!       /* fake a call to the signal handler routines to do a panic save */
! #ifdef USG
!       signal_save_core (-1);
! #else
!       signal_save_core (-1, -1, (struct sigcontext *)0);
! #endif
!     }
!   *ch = i;
    msg_flag = FALSE;
  }
*** oldmoria/main.c	Sun Oct 30 01:18:08 1988
--- newmoria/main.c	Sun Oct 30 01:07:39 1988
***************
*** 134,138 ****
    if ((argc > 1) && strlen(argv[argc-1]))
      {     /* Retrieve character    */
!       generate = get_char(argv[argc-1]);
        change_name();
        magic_init();
--- 134,138 ----
    if ((argc > 1) && strlen(argv[argc-1]))
      {     /* Retrieve character    */
!       get_char(argv[argc-1]);
        change_name();
        magic_init();
***************
*** 154,158 ****
        py.misc.cmana = (double)py.misc.mana;
        magic_init();
!       generate = TRUE;
      }
  
--- 154,162 ----
        py.misc.cmana = (double)py.misc.mana;
        magic_init();
!       generate_cave();
!       /* prevent ^c quit from entering score into scoreboard,
! 	 and prevent signal from creating panic save until this point,
! 	 all info needed for save file is now valid */
!       character_generated = 1;
      }
  
***************
*** 164,175 ****
    clear_screen(0, 0);
    prt_stat_block();
-   /* prevent ^c quit from entering score into scoreboard until this point */
-   character_generated = 1;
  
    /* Loop till dead, or exit			*/
    while(!death) {
-     if (generate)  generate_cave();         /* New level     */
      dungeon();                                  /* Dungeon logic */
!     generate = TRUE;
    }
    upon_death();                         /* Character gets buried */
--- 168,176 ----
    clear_screen(0, 0);
    prt_stat_block();
  
    /* Loop till dead, or exit			*/
    while(!death) {
      dungeon();                                  /* Dungeon logic */
!     generate_cave ();                      /* New level */
    }
    upon_death();                         /* Character gets buried */
*** oldmoria/misc1.c	Sun Oct 30 01:17:20 1988
--- newmoria/misc1.c	Sun Oct 30 01:07:30 1988
***************
*** 740,744 ****
  	mon_ptr->csleep = 0;
        else
! 	mon_ptr->csleep = (c_list[z].sleep/5.0) + randint(c_list[z].sleep);
      }
    else
--- 740,744 ----
  	mon_ptr->csleep = 0;
        else
! 	mon_ptr->csleep = (c_list[z].sleep / 5) + randint(c_list[z].sleep);
      }
    else
***************
*** 1074,1078 ****
    /* abs may be a macro, don't call it with randnor as a parameter */
    tmp = randnor(0, stand_dev);
!   x = (abs(tmp)/10.0) + base;
    if (x < base)
      return(base);
--- 1074,1078 ----
    /* abs may be a macro, don't call it with randnor as a parameter */
    tmp = randnor(0, stand_dev);
!   x = (abs(tmp) / 10) + base;
    if (x < base)
      return(base);
*** oldmoria/misc2.c	Sun Oct 30 01:17:07 1988
--- newmoria/misc2.c	Sun Oct 30 01:07:40 1988
***************
*** 291,295 ****
  
    popt(&cur_pos);
!   i = ((randint(dun_level+2)+2)/2.0) - 1;
    if (randint(OBJ_GREAT) == 1)
      i += randint(dun_level+1);
--- 291,295 ----
  
    popt(&cur_pos);
!   i = ((randint(dun_level+2)+2) / 2) - 1;
    if (randint(OBJ_GREAT) == 1)
      i += randint(dun_level+1);
***************
*** 439,443 ****
  /* Print character stat in given row, column		-RAK-	*/
  prt_stat(stat_name, stat, row, column)
! vtype stat_name;
  byteint stat;
  int row, column;
--- 439,443 ----
  /* Print character stat in given row, column		-RAK-	*/
  prt_stat(stat_name, stat, row, column)
! char *stat_name;
  byteint stat;
  int row, column;
***************
*** 456,460 ****
  /* the longest title is 13 characters, so only pad to 13 */
  prt_field(info, row, column)
! vtype info;
  int row, column;
  {
--- 456,460 ----
  /* the longest title is 13 characters, so only pad to 13 */
  prt_field(info, row, column)
! char *info;
  int row, column;
  {
***************
*** 465,469 ****
  /* Print number with header at given row, column 	-RAK-	*/
  prt_num(header, num, row, column)
! vtype header;
  int num, row, column;
  {
--- 465,469 ----
  /* Print number with header at given row, column 	-RAK-	*/
  prt_num(header, num, row, column)
! char *header;
  int num, row, column;
  {
***************
*** 1367,1371 ****
  /* Print list of spells					-RAK-	*/
  print_new_spells(spell, num, redraw)
! spl_type spell;
  register int num;
  int *redraw;
--- 1367,1371 ----
  /* Print list of spells					-RAK-	*/
  print_new_spells(spell, num, redraw)
! spl_rec *spell;
  register int num;
  int *redraw;
***************
*** 1392,1399 ****
  /* Returns spell pointer 				-RAK-	*/
  int get_spell(spell, num, sn, sc, prompt, redraw)
! spl_type spell;
  register int num;
  register int *sn, *sc;
! vtype prompt;
  int *redraw;
  {
--- 1392,1399 ----
  /* Returns spell pointer 				-RAK-	*/
  int get_spell(spell, num, sn, sc, prompt, redraw)
! spl_rec *spell;
  register int num;
  register int *sn, *sc;
! char *prompt;
  int *redraw;
  {
***************
*** 1844,1848 ****
        else if (p_ptr->cdex < 118)  blows = 5;
        else                         blows = 6;
!       adj_weight = ((p_ptr->cstr*10)/weight);
        if      (adj_weight < 2)  blows = 1;
        else if (adj_weight < 3)  blows = (blows/3.0) + 1;
--- 1844,1848 ----
        else if (p_ptr->cdex < 118)  blows = 5;
        else                         blows = 6;
!       adj_weight = ((p_ptr->cstr*10) / weight);
        if      (adj_weight < 2)  blows = 1;
        else if (adj_weight < 3)  blows = (blows/3.0) + 1;
*** oldmoria/monsters.c	Sun Oct 30 01:16:38 1988
--- newmoria/monsters.c	Sun Oct 30 01:07:49 1988
***************
*** 610,614 ****
    20,  48, 1, 'T', "14d8"  , "1 1 1d8|1 1 1d8|1 2 1d6|1 2 1d6",   32},
  {"Invisible Stalker"        ,0x00030022,0x00000000,0x0000,  200,  200,
!   20,  46, 3, 'E', "19d8"  , "1 1 1d6"                        ,   32},
  {"Giant Hunter Ant"         ,0x00000002,0x00000000,0x0002,   10,  150,
    16,  40, 1, 'a', "12d8"   , "1 2 4d8"                        ,   32},
--- 610,614 ----
    20,  48, 1, 'T', "14d8"  , "1 1 1d8|1 1 1d8|1 2 1d6|1 2 1d6",   32},
  {"Invisible Stalker"        ,0x00030022,0x00000000,0x0000,  200,  200,
!   20,  46, 3, 'I', "19d8"  , "1 1 1d6"                        ,   32},
  {"Giant Hunter Ant"         ,0x00000002,0x00000000,0x0002,   10,  150,
    16,  40, 1, 'a', "12d8"   , "1 2 4d8"                        ,   32},
*** oldmoria/moria1.c	Sun Oct 30 01:17:01 1988
--- newmoria/moria1.c	Sun Oct 30 01:07:54 1988
***************
*** 1375,1380 ****
  /* When blinded,  move only the player symbol...		*/
  sub3_move_light(y1, x1, y2, x2)
! register int x1, y1;
! int x2, y2;
  {
    register int i, j;
--- 1375,1380 ----
  /* When blinded,  move only the player symbol...		*/
  sub3_move_light(y1, x1, y2, x2)
! register int y1, x1;
! int y2, x2;
  {
    register int i, j;
***************
*** 1393,1397 ****
  /* With no light,  movement becomes involved...		*/
  sub4_move_light(y1, x1, y2, x2)
! register y1, x1;
  int y2, x2;
  {
--- 1393,1397 ----
  /* With no light,  movement becomes involved...		*/
  sub4_move_light(y1, x1, y2, x2)
! register int y1, x1;
  int y2, x2;
  {
***************
*** 1645,1651 ****
    p_ptr = &py.flags;
    if (p_ptr->confused+p_ptr->blind > 0)
!     chance = chance / 10.0;
    else if (no_light())
!     chance = chance / 5.0;
    for (i = (y - 1); i <= (y + 1); i++)
      for (j = (x - 1); j <= (x + 1); j++)
--- 1645,1651 ----
    p_ptr = &py.flags;
    if (p_ptr->confused+p_ptr->blind > 0)
!     chance = chance / 10;
    else if (no_light())
!     chance = chance / 5;
    for (i = (y - 1); i <= (y + 1); i++)
      for (j = (x - 1); j <= (x + 1); j++)
***************
*** 1724,1728 ****
  	}
      }
!   if ((find_flag) && (py.flags.blind < 1))
      {
        switch(dir)
--- 1724,1728 ----
  	}
      }
!   if (py.flags.blind < 1)
      {
        switch(dir)
***************
*** 1784,1799 ****
  	      /* Objects player can see*/
  	      /* Including doors       */
! 	      if (find_flag)
! 		if (player_light)
! 		  {
! 		    if (c_ptr->tptr != 0)
! 		      if ((t_list[c_ptr->tptr].tval != 101) &&
! 			  (t_list[c_ptr->tptr].tval != 109))
! 			{
! 			  find_flag = FALSE;  /* no need to call move_light */
! 			  return;
! 			}
! 		  }
! 		else if ((c_ptr->tl) || (c_ptr->pl) || (c_ptr->fm))
  		  if (c_ptr->tptr != 0)
  		    if ((t_list[c_ptr->tptr].tval != 101) &&
--- 1784,1789 ----
  	      /* Objects player can see*/
  	      /* Including doors       */
! 	      if (player_light)
! 		{
  		  if (c_ptr->tptr != 0)
  		    if ((t_list[c_ptr->tptr].tval != 101) &&
***************
*** 1803,1818 ****
  			return;
  		      }
! 	      /* Creatures             */
! 	      if (find_flag)
! 		if ((c_ptr->tl) || (c_ptr->pl) || (player_light))
! 		  if (c_ptr->cptr > 1)
  		    {
! 		      m_ptr = &m_list[c_ptr->cptr];
! 		      if (m_ptr->ml)
! 			{
! 			  find_flag = FALSE;  /* no need to call move_light */
! 			  return;
! 			}
  		    }
  	    }
  	}
--- 1793,1816 ----
  			return;
  		      }
! 		}
! 	      else if ((c_ptr->tl) || (c_ptr->pl) || (c_ptr->fm))
! 		if (c_ptr->tptr != 0)
! 		  if ((t_list[c_ptr->tptr].tval != 101) &&
! 		      (t_list[c_ptr->tptr].tval != 109))
  		    {
! 		      find_flag = FALSE;  /* no need to call move_light */
! 		      return;
  		    }
+ 	      /* Creatures             */
+ 	      if ((c_ptr->tl) || (c_ptr->pl) || (player_light))
+ 		if (c_ptr->cptr > 1)
+ 		  {
+ 		    m_ptr = &m_list[c_ptr->cptr];
+ 		    if (m_ptr->ml)
+ 		      {
+ 			find_flag = FALSE;  /* no need to call move_light */
+ 			return;
+ 		      }
+ 		  }
  	    }
  	}
*** oldmoria/moria2.c	Sun Oct 30 01:16:49 1988
--- newmoria/moria2.c	Sun Oct 30 01:07:42 1988
***************
*** 352,355 ****
--- 352,361 ----
    if (!find_range(90, 91, &i, &k))
      msg_print("You are not carrying any books.");
+   else if (py.flags.blind > 0)
+     msg_print("You can't see to read your spell book!");
+   else if (no_light())
+     msg_print("You have no light to read by.");
+   else if (py.flags.confused > 0)
+     msg_print("You are too confused...");
    else if (get_item(&item_val, "Which Book?", &redraw, i, k))
      {
***************
*** 739,743 ****
        c_ptr = &c_list[m_ptr->mptr];
        p_ptr = &py.misc;
!       acc_tmp = c_ptr->mexp*((c_ptr->level+0.1)/p_ptr->lev);
        i = (int)(acc_tmp);
        acc_exp += (acc_tmp - i);
--- 745,749 ----
        c_ptr = &c_list[m_ptr->mptr];
        p_ptr = &py.misc;
!       acc_tmp = c_ptr->mexp * ((float) c_ptr->level / (float) p_ptr->lev);
        i = (int)(acc_tmp);
        acc_exp += (acc_tmp - i);
***************
*** 1126,1130 ****
  		if (tmp_str != 0)
  		  tmp_str[0] = '\0';
! 		(void) strcat(t_ptr->name, " (Empty)");
  		known2(t_ptr->name);
  		t_ptr->cost = 0;
--- 1132,1136 ----
  		if (tmp_str != 0)
  		  tmp_str[0] = '\0';
! 		(void) strcat(t_ptr->name, "(Empty)");
  		known2(t_ptr->name);
  		t_ptr->cost = 0;
***************
*** 1150,1154 ****
        else
  	msg_print("I do not see anything you can open there.");
! 	}
  }
  
--- 1156,1160 ----
        else
  	msg_print("I do not see anything you can open there.");
!     }
  }
  
***************
*** 1380,1388 ****
  	  tot = t1 + t2 + t3 + t4;
  	  if (py.flags.blind > 0)
! 	    tot = tot / 5.0;
  	  else if (no_light())
! 	    tot = tot / 2.0;
  	  if (py.flags.confused > 0)
! 	    tot = tot / 3.0;
  	  i = t_list[c_ptr->tptr].tval;
  	  t5 = t_list[c_ptr->tptr].level;
--- 1386,1394 ----
  	  tot = t1 + t2 + t3 + t4;
  	  if (py.flags.blind > 0)
! 	    tot = tot / 5;
  	  else if (no_light())
! 	    tot = tot / 2;
  	  if (py.flags.confused > 0)
! 	    tot = tot / 3;
  	  i = t_list[c_ptr->tptr].tval;
  	  t5 = t_list[c_ptr->tptr].level;
***************
*** 1424,1430 ****
  		        tmp_str[0] = '\0';
  		      if (0x00000001 & i_ptr->flags)
! 			(void) strcat(i_ptr->name, " (Locked)");
  		      else
! 			(void) strcat(i_ptr->name, " (Disarmed)");
  		      msg_print("You have disarmed the chest.");
  		      known2(i_ptr->name);
--- 1430,1436 ----
  		        tmp_str[0] = '\0';
  		      if (0x00000001 & i_ptr->flags)
! 			(void) strcat(i_ptr->name, "(Locked)");
  		      else
! 			(void) strcat(i_ptr->name, "(Disarmed)");
  		      msg_print("You have disarmed the chest.");
  		      known2(i_ptr->name);
***************
*** 1888,1895 ****
  	      i_ptr->tval   = 1;
  	      p_ptr = &py;
! 	      p_ptr->misc.bth    = ((p_ptr->stats.cstr+
! 					 p_ptr->misc.wt)/6.0);
  	      p_ptr->misc.ptohit = 0;
! 	      p_ptr->misc.ptodam = (p_ptr->misc.wt/75.0) + 1;
  	      if (py_attack(y, x))
  		{
--- 1894,1900 ----
  	      i_ptr->tval   = 1;
  	      p_ptr = &py;
! 	      p_ptr->misc.bth    = ((p_ptr->stats.cstr + p_ptr->misc.wt) / 6);
  	      p_ptr->misc.ptohit = 0;
! 	      p_ptr->misc.ptodam = (p_ptr->misc.wt / 75) + 1;
  	      if (py_attack(y, x))
  		{
*** oldmoria/potions.c	Sun Oct 30 01:17:27 1988
--- newmoria/potions.c	Sun Oct 30 01:07:42 1988
***************
*** 253,257 ****
  		      msg_print("You feel your memories fade...");
  		      /* avoid randint(0) call */
! 		      l = (py.misc.exp/5.0);
  		      if (l == 0)
  			lose_exp(1);
--- 253,257 ----
  		      msg_print("You feel your memories fade...");
  		      /* avoid randint(0) call */
! 		      l = (py.misc.exp / 5);
  		      if (l == 0)
  			lose_exp(1);
***************
*** 360,364 ****
  		{
  		  m_ptr = &py.misc;
! 		  m_ptr->exp += (int)(i_ptr->level/m_ptr->lev + 0.5);
  		  prt_experience();
  		}
--- 360,364 ----
  		{
  		  m_ptr = &py.misc;
! 		  m_ptr->exp += (((float) i_ptr->level / (float) m_ptr->lev) + 0.5);
  		  prt_experience();
  		}
*** oldmoria/save.c	Sun Oct 30 01:17:39 1988
--- newmoria/save.c	Sun Oct 30 01:07:43 1988
***************
*** 311,315 ****
    else if (flag)
      {
!       (void) sprintf(temp,"Character saved. [Moria Version %lf]",CUR_VERSION);
        prt(temp, 0, 0);
        if (exit)
--- 311,315 ----
    else if (flag)
      {
!       (void) sprintf(temp,"Character saved. [Moria Version %.2lf]\n",CUR_VERSION);
        prt(temp, 0, 0);
        if (exit)
***************
*** 471,475 ****
    controlz();
  
!   if (buf.st_atime >= buf2.st_atime + 5)
      {
        (void) sprintf(temp, "File %s has been touched, sorry.", fnam);
--- 471,475 ----
    controlz();
  
!   if (buf.st_mtime >= buf2.st_mtime + 5)
      {
        (void) sprintf(temp, "File %s has been touched, sorry.", fnam);
***************
*** 495,499 ****
    else
      {
!       age = (long)buf2.st_atime - (long)buf.st_atime;  /* age in seconds */
        age = (age / 86400) + 1;  /* age in days */
        for (i = 0; i < age; i++)
--- 495,499 ----
    else
      {
!       age = (long)buf2.st_atime - (long)buf.st_mtime;  /* age in seconds */
        age = (age / 86400) + 1;  /* age in days */
        for (i = 0; i < age; i++)
***************
*** 508,511 ****
--- 508,517 ----
      }
  
+   /* prevent ^c quit from entering score into scoreboard,
+      and prevent signal from creating panic save until this point,
+      old save file has just been deleted */
+   character_generated = 1;
+ 
+ #ifndef SCORE_PANIC_SAVES
    if (panic_save == 1)
      {
***************
*** 515,518 ****
--- 521,525 ----
        msg_print (" ");
      }
+ #endif
  
    /* reidentify objects */
***************
*** 531,535 ****
        death = 1;
      }
- 
-   return(FALSE);
  }
--- 538,540 ----
*** oldmoria/scrolls.c	Sun Oct 30 01:18:02 1988
--- newmoria/scrolls.c	Sun Oct 30 01:07:44 1988
***************
*** 480,491 ****
  		    if (!first)
  		      {
- 			desc_remain(item_val);
- 			inven_destroy(item_val);
  			if (i_ptr->flags != 0)
  			  {
  			    m_ptr = &py.misc;
! 			    m_ptr->exp += (i_ptr->level/m_ptr->lev);
  			    prt_experience();
  			  }
  		      }
  		  }
--- 480,492 ----
  		    if (!first)
  		      {
  			if (i_ptr->flags != 0)
  			  {
  			    m_ptr = &py.misc;
! 			    m_ptr->exp += (((float) i_ptr->level / (float) m_ptr->lev)
! 					   + 0.5);
  			    prt_experience();
  			  }
+ 			desc_remain(item_val);
+ 			inven_destroy(item_val);
  		      }
  		  }
*** oldmoria/signals.c	Sun Oct 30 01:17:02 1988
--- newmoria/signals.c	Sun Oct 30 01:07:44 1988
***************
*** 14,18 ****
  
  extern int total_winner;
- extern int moria_flag;
  extern int search_flag;
  
--- 14,17 ----
***************
*** 74,78 ****
    error_sig = sig;
    error_code = 0;
!   if (!character_saved)
      {
        prt("OH NO!!!!!!!!!!  Attempting panic save.", 23, 0);
--- 73,77 ----
    error_sig = sig;
    error_code = 0;
!   if (!character_saved && character_generated)
      {
        prt("OH NO!!!!!!!!!!  Attempting panic save.", 23, 0);
***************
*** 110,114 ****
    error_sig = sig;
    error_code = code;
!   if (!character_saved)
      {
        prt("OH NO!!!!!!!!!!  Attempting panic save.", 23, 0);
--- 109,113 ----
    error_sig = sig;
    error_code = code;
!   if (!character_saved && character_generated)
      {
        prt("OH NO!!!!!!!!!!  Attempting panic save.", 23, 0);
***************
*** 147,151 ****
    error_sig = sig;
    error_code = 0;
!   if (!character_saved)
      save_char(FALSE, TRUE);
    exit_game();
--- 146,150 ----
    error_sig = sig;
    error_code = 0;
!   if (!character_saved && character_generated)
      save_char(FALSE, TRUE);
    exit_game();
***************
*** 163,167 ****
    error_sig = sig;
    error_code = code;
!   if (!character_saved)
      save_char(FALSE, TRUE);
    exit_game();
--- 162,166 ----
    error_sig = sig;
    error_code = code;
!   if (!character_saved && character_generated)
      save_char(FALSE, TRUE);
    exit_game();
***************
*** 186,189 ****
--- 185,190 ----
        return;
      }
+   /* flush input just in case */
+   flush ();
    if (get_com("Do you really want to quit?", &command))
      switch(command)
***************
*** 204,209 ****
      {
        put_buffer(" -more-", MSG_LINE, 0);
-       put_qio();
      }
  }
  #else
--- 205,210 ----
      {
        put_buffer(" -more-", MSG_LINE, 0);
      }
+   put_qio();
  }
  #else
***************
*** 223,226 ****
--- 224,229 ----
        return;
      }
+   /* flush input just in case */
+   flush();
    if (get_com("Do you really want to quit?", &command))
      switch(command)
***************
*** 241,246 ****
      {
        put_buffer(" -more-", MSG_LINE, 0);
-       put_qio();
      }
  }
  #endif
--- 244,249 ----
      {
        put_buffer(" -more-", MSG_LINE, 0);
      }
+   put_qio();
  }
  #endif
*** oldmoria/spells.c	Sun Oct 30 01:18:23 1988
--- newmoria/spells.c	Sun Oct 30 01:07:45 1988
***************
*** 499,502 ****
--- 499,503 ----
    register int destroy;
    register cave_type *c_ptr;
+   char *tmp_str;
  
    destroy = FALSE;
***************
*** 516,521 ****
  	      }
  	    else if (t_list[c_ptr->tptr].tval == 2)
! 	      /* destroy traps on chest and unlock */
! 	      t_list[c_ptr->tptr].flags &= 0xFF000000;
  	  }
        }
--- 517,530 ----
  	      }
  	    else if (t_list[c_ptr->tptr].tval == 2)
! 	      {
! 		/* destroy traps on chest and unlock */
! 		t_list[c_ptr->tptr].flags &= 0xFF000000;
! 		tmp_str = index(t_list[c_ptr->tptr].name, '(');
! 		if (tmp_str != 0)
! 		  tmp_str[0] = '\0';
! 		(void) strcat (t_list[c_ptr->tptr].name, "(Disarmed)");
! 		msg_print ("You have disarmed the chest.");
! 		known2 (t_list[c_ptr->tptr].name);
! 	      }
  	  }
        }
***************
*** 672,676 ****
  		if (i >= 0)
  		  t_ptr->name[i] = '\0';
! 		(void) strcat(t_ptr->name, " (Unlocked)");
  		known2(t_ptr->name);
  	      }
--- 681,685 ----
  		if (i >= 0)
  		  t_ptr->name[i] = '\0';
! 		(void) strcat(t_ptr->name, "(Unlocked)");
  		known2(t_ptr->name);
  	      }
***************
*** 737,741 ****
  int fire_bolt(typ, dir, y, x, dam, bolt_typ)
  int typ, dir, y, x, dam;
! ctype bolt_typ;
  {
    int i, oldy, oldx, dist;
--- 746,750 ----
  int fire_bolt(typ, dir, y, x, dam, bolt_typ)
  int typ, dir, y, x, dam;
! char *bolt_typ;
  {
    int i, oldy, oldx, dist;
***************
*** 784,788 ****
  		    dam = dam*2;
  		  else if (weapon_type & r_ptr->spells)
! 		    dam = (dam/4.0);
  		  i = mon_take_hit((int)c_ptr->cptr, dam);
  		  monster_name(m_name, m_ptr, r_ptr);
--- 793,797 ----
  		    dam = dam*2;
  		  else if (weapon_type & r_ptr->spells)
! 		    dam = (dam / 4);
  		  i = mon_take_hit((int)c_ptr->cptr, dam);
  		  monster_name(m_name, m_ptr, r_ptr);
***************
*** 830,834 ****
  int fire_ball(typ, dir, y, x, dam_hp, descrip)
  int typ, dir, y, x, dam_hp;
! ctype descrip;
  {
    register int i, j;
--- 839,843 ----
  int fire_ball(typ, dir, y, x, dam_hp, descrip)
  int typ, dir, y, x, dam_hp;
! char *descrip;
  {
    register int i, j;
***************
*** 1009,1013 ****
  		      dam = dam*2;
  		    else if (weapon_type & r_ptr->spells)
! 		      dam = (dam/4.0);
  		    dam = (dam/(distance(i, j, y, x)+1));
  		    m_ptr->hp = m_ptr->hp - dam;
--- 1018,1022 ----
  		      dam = dam*2;
  		    else if (weapon_type & r_ptr->spells)
! 		      dam = (dam / 4);
  		    dam = (dam/(distance(i, j, y, x)+1));
  		    m_ptr->hp = m_ptr->hp - dam;
***************
*** 1528,1533 ****
  		    }
  		}
- 	      else
- 		flag = TRUE;
  	    }
  	}
--- 1537,1540 ----
***************
*** 2167,2171 ****
  			      c_list[m_ptr->mptr].cmove);
  		p_ptr = &py.misc;
! 		p_ptr->exp += ((r_ptr->mexp*(r_ptr->level/p_ptr->lev)) + 0.5);
  		delete_monster(i);
  	      }
--- 2174,2179 ----
  			      c_list[m_ptr->mptr].cmove);
  		p_ptr = &py.misc;
! 		p_ptr->exp += ((r_ptr->mexp * ((float) r_ptr->level / (float) p_ptr->lev))
! 			       + 0.5);
  		delete_monster(i);
  	      }
***************
*** 2444,2448 ****
    if (f_ptr->poisoned > 0)
      {
!       f_ptr->poisoned = f_ptr->poisoned / 2.0;
        if (f_ptr->poisoned < 1)  f_ptr->poisoned = 1;
        slow = TRUE;
--- 2452,2456 ----
    if (f_ptr->poisoned > 0)
      {
!       f_ptr->poisoned = f_ptr->poisoned / 2;
        if (f_ptr->poisoned < 1)  f_ptr->poisoned = 1;
        slow = TRUE;
*** oldmoria/staffs.c	Sun Oct 30 01:18:17 1988
--- newmoria/staffs.c	Sun Oct 30 01:07:46 1988
***************
*** 29,33 ****
  	      chance = m_ptr->save + m_ptr->lev + int_adj() - i_ptr->level - 5;
  	      if (py.flags.confused > 0)
! 		chance = chance / 2.0;
  	      if (chance <= 0)  chance = 1;
  	      if (randint(chance) < USE_DEVICE)
--- 29,33 ----
  	      chance = m_ptr->save + m_ptr->lev + int_adj() - i_ptr->level - 5;
  	      if (py.flags.confused > 0)
! 		chance = chance / 2;
  	      if (chance <= 0)  chance = 1;
  	      if (randint(chance) < USE_DEVICE)
***************
*** 144,148 ****
  		    {
  		      m_ptr = &py.misc;
! 		      m_ptr->exp += ((i_ptr->level/m_ptr->lev) + 0.5);
  		      prt_experience();
  		    }
--- 144,148 ----
  		    {
  		      m_ptr = &py.misc;
! 		      m_ptr->exp += (((float)i_ptr->level / (float)m_ptr->lev) + 0.5);
  		      prt_experience();
  		    }
*** oldmoria/store1.c	Sun Oct 30 01:17:11 1988
--- newmoria/store1.c	Sun Oct 30 01:07:46 1988
***************
*** 122,126 ****
        else if (index(i_ptr->name, '^') == 0)
  	{
! 	  value = i_ptr->cost + (i_ptr->cost/20.0)*i_ptr->p1;
  	}
      }
--- 122,126 ----
        else if (index(i_ptr->name, '^') == 0)
  	{
! 	  value = i_ptr->cost + (i_ptr->cost / 20) * i_ptr->p1;
  	}
      }
*** oldmoria/store2.c	Sun Oct 30 01:17:56 1988
--- newmoria/store2.c	Sun Oct 30 01:07:47 1988
***************
*** 960,964 ****
        /* make sure player sees the message */
        msg_print(" ");
!       if ((store_buy[store_num])(inventory[INVEN_MAX].tval))
  	if (store_check_num(store_num))
  	  switch(sell_haggle(store_num, &price, inventory[INVEN_MAX]))
--- 960,964 ----
        /* make sure player sees the message */
        msg_print(" ");
!       if ((*store_buy[store_num])(inventory[INVEN_MAX].tval))
  	if (store_check_num(store_num))
  	  switch(sell_haggle(store_num, &price, inventory[INVEN_MAX]))
*** oldmoria/treasure1.c	Sun Oct 30 01:16:43 1988
--- newmoria/treasure1.c	Sun Oct 30 01:07:56 1988
***************
*** 637,641 ****
  {"& Light Brown Potion~| of Apple Juice"           ,  75, '!',0x00000000,
    250,      1, 282,   4,   1,   0,   0,   0,   0, "1d1"  ,  0},
! {"& Clear Potion~| of Water"                       ,  75, '!',0x00000000,
    200,      0, 283,   4,   1,   0,   0,   0,   0, "1d1"  ,  0},
  {"& %C Potion~| of Gain Dexterity"                 ,  75, '!',0x02000000,
--- 637,641 ----
  {"& Light Brown Potion~| of Apple Juice"           ,  75, '!',0x00000000,
    250,      1, 282,   4,   1,   0,   0,   0,   0, "1d1"  ,  0},
! {"& Crystal Clear Potion~| of Water"               ,  75, '!',0x00000000,
    200,      0, 283,   4,   1,   0,   0,   0,   0, "1d1"  ,  0},
  {"& %C Potion~| of Gain Dexterity"                 ,  75, '!',0x02000000,
***************
*** 775,793 ****
  {"& %W Staff| of Darkness^ (%P1 charges)"          ,  55, '_',0x01000000,
      0,      0,  25,  50,   1,   0,   0,   0,   0, "1d2"  ,  5},
! {"& Book of Magic Spells [Beginners-Magik]"        ,  90, '?',0x0000007F,
      0,     25, 257,  30,   1,-100,   0,   0,   0, "1d1"  , 40},
! {"& Book of Magic Spells [Magik I]"                ,  90, '?',0x0000FF80,
      0,    100, 258,  30,   1,-100,   0,   0,   0, "1d1"  , 40},
! {"& Book of Magic Spells [Magik II]"               ,  90, '?',0x00FF0000,
      0,    400, 259,  30,   1,-100,   0,   0,   0, "1d1"  , 40},
! {"& Book of Magic Spells [The Mage's Guide to Power]",  90, '?',0x7F000000,
      0,    800, 261,  30,   1,-100,   0,   0,   0, "1d1"  , 40},
! {"& Holy Book of Prayers [Beginners Handbook]"     ,  91, '?',0x000000FF,
      0,     25, 258,  30,   1,-100,   0,   0,   0, "1d1"  , 40},
! {"& Holy Book of Prayers [Words of Wisdom]"        ,  91, '?',0x0000FF00,
      0,    100, 259,  30,   1,-100,   0,   0,   0, "1d1"  , 40},
! {"& Holy Book of Prayers [Chants and Blessings]"   ,  91, '?',0x01FF0000,
      0,    300, 260,  30,   1,-100,   0,   0,   0, "1d1"  , 40},
! {"& Holy Book of Prayers [Exorcism and Dispelling]",  91, '?',0x7E000000,
      0,    900, 261,  30,   1,-100,   0,   0,   0, "1d1"  , 40},
  {"& Small wooden chest"                            ,   2, '&',0x0F000000,
--- 775,793 ----
  {"& %W Staff| of Darkness^ (%P1 charges)"          ,  55, '_',0x01000000,
      0,      0,  25,  50,   1,   0,   0,   0,   0, "1d2"  ,  5},
! {"& Book~ of Magic Spells [Beginners-Magik]"       ,  90, '?',0x0000007F,
      0,     25, 257,  30,   1,-100,   0,   0,   0, "1d1"  , 40},
! {"& Book~ of Magic Spells [Magik I]"               ,  90, '?',0x0000FF80,
      0,    100, 258,  30,   1,-100,   0,   0,   0, "1d1"  , 40},
! {"& Book~ of Magic Spells [Magik II]"              ,  90, '?',0x00FF0000,
      0,    400, 259,  30,   1,-100,   0,   0,   0, "1d1"  , 40},
! {"& Book~ of Magic Spells [The Mage's Guide to Power]",  90, '?',0x7F000000,
      0,    800, 261,  30,   1,-100,   0,   0,   0, "1d1"  , 40},
! {"& Holy Book~ of Prayers [Beginners Handbook]"    ,  91, '?',0x000000FF,
      0,     25, 258,  30,   1,-100,   0,   0,   0, "1d1"  , 40},
! {"& Holy Book~ of Prayers [Words of Wisdom]"       ,  91, '?',0x0000FF00,
      0,    100, 259,  30,   1,-100,   0,   0,   0, "1d1"  , 40},
! {"& Holy Book~ of Prayers [Chants and Blessings]"  ,  91, '?',0x01FF0000,
      0,    300, 260,  30,   1,-100,   0,   0,   0, "1d1"  , 40},
! {"& Holy Book~ of Prayers [Exorcism and Dispelling]",  91, '?',0x7E000000,
      0,    900, 261,  30,   1,-100,   0,   0,   0, "1d1"  , 40},
  {"& Small wooden chest"                            ,   2, '&',0x0F000000,
*** oldmoria/treasure2.c	Sun Oct 30 01:17:50 1988
--- newmoria/treasure2.c	Sun Oct 30 01:07:58 1988
***************
*** 98,104 ****
  {"& Strip~ of Beef Jerky"                          ,  80, ',',0x00000000,
   1750,      2, 310,   2,   5,   0,   0,   0,   0, "0d0"  ,  0}, /*  3*/
! {"& Pint of Fine Ale"                              ,  80, ',',0x00000000,
    500,      1, 311,  10,   3,   0,   0,   0,   0, "0d0"  ,  0}, /*  4*/
! {"& Pint of Fine Wine"                             ,  80, ',',0x00000000,
    400,      2, 312,  10,   1,   0,   0,   0,   0, "0d0"  ,  0}, /*  5*/
  {"& Dagger (Misericorde) (%P2,%P3)"                ,  23, '|',0x00000000,
--- 98,104 ----
  {"& Strip~ of Beef Jerky"                          ,  80, ',',0x00000000,
   1750,      2, 310,   2,   5,   0,   0,   0,   0, "0d0"  ,  0}, /*  3*/
! {"& Pint~ of Fine Ale"                              ,  80, ',',0x00000000,
    500,      1, 311,  10,   3,   0,   0,   0,   0, "0d0"  ,  0}, /*  4*/
! {"& Pint~ of Fine Wine"                            ,  80, ',',0x00000000,
    400,      2, 312,  10,   1,   0,   0,   0,   0, "0d0"  ,  0}, /*  5*/
  {"& Dagger (Misericorde) (%P2,%P3)"                ,  23, '|',0x00000000,
***************
*** 224,242 ****
  {"& Scroll~ of Recharging"                         ,  70, '?',0x01000000,
      0,    200, 311,   5,   1,   0,   0,   0,   0, "0d0"  ,  0}, /* 66*/
! {"& Book of Magic Spells [Beginners-Magik]"        ,  90, '?',0x0000007F,
      0,     25, 257,  30,   1,-100,   0,   0,   0, "1d1"  ,  0}, /* 67*/
! {"& Book of Magic Spells [Magik I]"                ,  90, '?',0x0000FF80,
      0,    100, 258,  30,   1,-100,   0,   0,   0, "1d1"  ,  0}, /* 68*/
! {"& Book of Magic Spells [Magik II]"               ,  90, '?',0x00FF0000,
      0,    400, 259,  30,   1,-100,   0,   0,   0, "1d1"  ,  0}, /* 69*/
! {"& Book of Magic Spells [The Mage's Guide to Power]",  90, '?',0x7F000000,
      0,    800, 261,  30,   1,-100,   0,   0,   0, "1d1"  ,  0}, /* 70*/
! {"& Holy Book of Prayers [Beginners Handbook]"     ,  91, '?',0x000000FF,
      0,     25, 258,  30,   1,-100,   0,   0,   0, "1d1"  ,  0}, /* 71*/
! {"& Holy Book of Prayers [Words of Wisdom]"        ,  91, '?',0x0000FF00,
      0,    100, 259,  30,   1,-100,   0,   0,   0, "1d1"  ,  0}, /* 72*/
! {"& Holy Book of Prayers [Chants and Blessings]"   ,  91, '?',0x01FF0000,
      0,    300, 260,  30,   1,-100,   0,   0,   0, "1d1"  ,  0}, /* 73*/
! {"& Holy Book of Prayers [Exorcism and Dispelling]",  91, '?',0x7E000000,
      0,    900, 261,  30,   1,-100,   0,   0,   0, "1d1"  ,  0}, /* 74*/
  {"& Potion~ of Restore Strength"                   ,  75, '!',0x00000004,
--- 224,242 ----
  {"& Scroll~ of Recharging"                         ,  70, '?',0x01000000,
      0,    200, 311,   5,   1,   0,   0,   0,   0, "0d0"  ,  0}, /* 66*/
! {"& Book~ of Magic Spells [Beginners-Magik]"       ,  90, '?',0x0000007F,
      0,     25, 257,  30,   1,-100,   0,   0,   0, "1d1"  ,  0}, /* 67*/
! {"& Book~ of Magic Spells [Magik I]"               ,  90, '?',0x0000FF80,
      0,    100, 258,  30,   1,-100,   0,   0,   0, "1d1"  ,  0}, /* 68*/
! {"& Book~ of Magic Spells [Magik II]"              ,  90, '?',0x00FF0000,
      0,    400, 259,  30,   1,-100,   0,   0,   0, "1d1"  ,  0}, /* 69*/
! {"& Book~ of Magic Spells [The Mage's Guide to Power]",  90, '?',0x7F000000,
      0,    800, 261,  30,   1,-100,   0,   0,   0, "1d1"  ,  0}, /* 70*/
! {"& Holy Book~ of Prayers [Beginners Handbook]"    ,  91, '?',0x000000FF,
      0,     25, 258,  30,   1,-100,   0,   0,   0, "1d1"  ,  0}, /* 71*/
! {"& Holy Book~ of Prayers [Words of Wisdom]"       ,  91, '?',0x0000FF00,
      0,    100, 259,  30,   1,-100,   0,   0,   0, "1d1"  ,  0}, /* 72*/
! {"& Holy Book~ of Prayers [Chants and Blessings]"  ,  91, '?',0x01FF0000,
      0,    300, 260,  30,   1,-100,   0,   0,   0, "1d1"  ,  0}, /* 73*/
! {"& Holy Book~ of Prayers [Exorcism and Dispelling]",  91, '?',0x7E000000,
      0,    900, 261,  30,   1,-100,   0,   0,   0, "1d1"  ,  0}, /* 74*/
  {"& Potion~ of Restore Strength"                   ,  75, '!',0x00000004,
***************
*** 426,428 ****
  {"a down staircase"                                , 108, '>',0x00000000,
      0,      0,   1,   0,   1,   0,   0,   0,   0, "1d1"  ,  0};
- 
--- 426,427 ----
*** oldmoria/types.h	Sun Oct 30 01:17:08 1988
--- newmoria/types.h	Sun Oct 30 01:07:48 1988
***************
*** 191,195 ****
  } spl_rec;
  
! typedef spl_rec spl_type[22];
  
  typedef struct race_type
--- 191,195 ----
  } spl_rec;
  
! typedef spl_rec spl_type[32];
  
  typedef struct race_type
*** oldmoria/variables.c	Sun Oct 30 01:17:14 1988
--- newmoria/variables.c	Sun Oct 30 01:07:51 1988
***************
*** 16,20 ****
  int missile_ctr = 0;             /* Counter for missiles */
  int msg_flag;	                /* Set with first msg  */
- int generate;	                /* Generate next level */
  int death = FALSE;	        /* True if died	      */
  vtype died_from;	        /* What killed him     */
--- 16,19 ----
*** oldmoria/wands.c	Sun Oct 30 01:16:56 1988
--- newmoria/wands.c	Sun Oct 30 01:07:49 1988
***************
*** 46,50 ****
  		  chance = m_ptr->save + m_ptr->lev + int_adj() - i_ptr->level;
  		  if (py.flags.confused > 0)
! 		    chance = chance / 2.0;
  		  if (chance <= 0)  chance = 1;
  		  if (randint(chance) < USE_DEVICE)
--- 46,50 ----
  		  chance = m_ptr->save + m_ptr->lev + int_adj() - i_ptr->level;
  		  if (py.flags.confused > 0)
! 		    chance = chance / 2;
  		  if (chance <= 0)  chance = 1;
  		  if (randint(chance) < USE_DEVICE)
***************
*** 158,162 ****
  			{
  			  m_ptr = &py.misc;
! 			  m_ptr->exp += ((i_ptr->level/m_ptr->lev) + 0.5);
  			  prt_experience();
  			}
--- 158,162 ----
  			{
  			  m_ptr = &py.misc;
! 			  m_ptr->exp += (((float)i_ptr->level / (float)m_ptr->lev) + 0.5);
  			  prt_experience();
  			}
*** oldmoria/wizard.c	Sun Oct 30 01:18:09 1988
--- newmoria/wizard.c	Sun Oct 30 01:07:50 1988
***************
*** 23,27 ****
  
    clear_screen(0, 0);
!   (void) sprintf(tmp_str, "               Moria Version %f", CUR_VERSION);
    put_buffer(tmp_str, 0, 0);
    put_buffer("Version 0.1  : 03/25/83", 1, 0);
--- 23,27 ----
  
    clear_screen(0, 0);
!   (void) sprintf(tmp_str, "               Moria Version %.2lf", CUR_VERSION);
    put_buffer(tmp_str, 0, 0);
    put_buffer("Version 0.1  : 03/25/83", 1, 0);
***************
*** 54,57 ****
--- 54,60 ----
    put_buffer("Please call it 'umoria' or 'UNIX MORIA' or something", 9, 0);
    put_buffer("similar to avoid confusion.", 10, 0);
+   (void) sprintf(tmp_str, "Moria Version %.2lf, patch level %d", CUR_VERSION,
+ 		 PATCH_LEVEL);
+   put_buffer(tmp_str, 12, 0);
    pause_line(23);
    draw_cave();