[comp.sources.games.bugs] Unofficial patch to Omega 0.75

ameiba@reed.UUCP (Keith Steiger) (08/26/89)

This file contains a patch for Omega 0.75.  It fixes all serious bugs,
wasted characters, and other strange things.  A full list follows.

1. It completely rewrites the high score file system.  Previously, the high
scores were erratic if you were running on a multi-user system or you were
playing more than one character at the same time.  This was due to the fact
that a copy of the high score file was placed in every character save file.
Furthermore, it loaded the high scores only once, at the start, so if
someone else got a high score while you were playing, you would overwrite
their high scores with your outdated copy.  This was the biggest rewrite,
and probably the most important fix.

2. It no longer bothers to redraw the screen after asking about your "NPC
behavior", as this only happens when you are exiting Omega.

3. Scrolls are now destroyed before their effects are done, thus removing
any chance of dropping a scroll of acquisition.

4. The "How many? Change with < or >, ESCAPE to select:" requester has been
replaced in every instance with the one that just lets you type in the number.
I see no advantage in having to hit '>' 9 times to drop 10 food rations.

5. The long inventory method has been flagged and adjusted in order to
minimize the amount of characters sent to the screen.  Previously, it
reprinted the "up in air" slot and the slot under the arrow whether it had
to or not.

6. The statue feature that illuminates the level now takes only a few
seconds instead of the minutes it did previously.

7. The library can raise your INT to 30 instead of just 29, putting it into
sync with the gym.

8. Choosing "Lunge:" as a combat feature was displayed incorrectly.  This
was a trivial fix.


It's amazing that I haven't found as many bugs as I have, considering the
sheer size of the source.

Good luck, and may all your azoth be blessed.


	Keith Steiger, ameiba@reed.UUCP


--------------------cut here and send this file to patch-----------------------
*** o/ochar.c	Thu Aug 17 21:15:03 1989
--- ochar.c	Thu Aug 17 21:15:17 1989
***************
*** 213,219 ****
        response = menugetc();
      menuaddch(response);
      npcbehavior+=1000*(response - '0');
-     xredraw();
    }
      return(npcbehavior);
  }
--- 213,218 ----
*** o/ocom2.c	Mon Aug 14 22:40:45 1989
--- ocom2.c	Sat Aug 19 01:35:27 1989
***************
*** 34,40 ****
  void peruse()
  {
    int index;
!   struct object *obj;
  
    clearmsg();
  
--- 34,40 ----
  void peruse()
  {
    int index;
!   struct object *obj, objcopy;
  
    clearmsg();
  
***************
*** 56,63 ****
        else {
  	nprint1("You carefully unfurl the scroll....");
  	morewait();
! 	item_use(obj);
  	dispose_lost_objects(1,obj);
        }
      }
    }
--- 56,64 ----
        else {
  	nprint1("You carefully unfurl the scroll....");
  	morewait();
! 	objcopy = *obj;
  	dispose_lost_objects(1,obj);
+ 	item_use(&objcopy);
        }
      }
    }
***************
*** 232,238 ****
  	conform_lost_objects(1,Player.possessions[index]);
        }
        else {
! 	n = getnumber(Player.possessions[index]->number);
  	p_drop_at(Player.x,Player.y,n,Player.possessions[index]);
  	conform_lost_objects(n,Player.possessions[index]);
        }
--- 233,239 ----
  	conform_lost_objects(1,Player.possessions[index]);
        }
        else {
! 	n = get_item_number(Player.possessions[index]);
  	p_drop_at(Player.x,Player.y,n,Player.possessions[index]);
  	conform_lost_objects(n,Player.possessions[index]);
        }
*** o/ocom3.c	Tue Aug 15 18:21:05 1989
--- ocom3.c	Tue Aug 15 18:21:40 1989
***************
*** 666,676 ****
  	if (Player.possessions[O_WEAPON_HAND] != NULL) {
  	  if (Player.possessions[O_WEAPON_HAND]->type != MISSILE) {
  	    Player.meleestr[place] = 'L';
  	    place++;
  	    Player.meleestr[place]=getlocation();
  	    place++;
  	    actionsleft -= 2;
- 	    menuprint("\nLunge:");
  	  }
  	  else {
  	    print3("Can't lunge with a missile weapon!");
--- 666,676 ----
  	if (Player.possessions[O_WEAPON_HAND] != NULL) {
  	  if (Player.possessions[O_WEAPON_HAND]->type != MISSILE) {
  	    Player.meleestr[place] = 'L';
+ 	    menuprint("\nLunge:");
  	    place++;
  	    Player.meleestr[place]=getlocation();
  	    place++;
  	    actionsleft -= 2;
  	  }
  	  else {
  	    print3("Can't lunge with a missile weapon!");

*** o/ofile.c	Thu Aug 24 14:45:45 1989
--- ofile.c	Thu Aug 24 15:57:17 1989
***************
*** 226,232 ****
  
  
  
! void showscores()
  {
    FILE *fd;
    int i;
--- 226,232 ----
  
  
  
! void loadscores()
  {
    FILE *fd;
    int i;
***************
*** 263,268 ****
--- 263,272 ----
      fscanf(fd,"%d\n%d\n",&(Priestlevel[i]),&(Priestbehavior[i]));
    }
    fclose(fd);
+ }
+ 
+ void showscores()
+ {
    clear();
  #ifndef MSDOS
    printw("High Score: %d",Hiscore);
***************
*** 306,312 ****
  }
  
  
! /* writes a new high score file */
  void checkhigh(descrip,behavior)
  char *descrip;
  int behavior;
--- 310,316 ----
  }
  
  
! /* checks for high scores, lord of law, lord of chaos */
  void checkhigh(descrip,behavior)
  char *descrip;
  int behavior;
***************
*** 317,441 ****
    int i;
    long points;
  #endif
-   FILE *fd;
  
    if (FixedPoints > 0) points = FixedPoints;
    else points = calc_points();
  
    if (! gamestatusp(CHEATED)) {
-     strcpy(Str1,OMEGALIB);
-     strcat(Str1,"omega.hi");
-     fd = checkfopen(Str1,"w");
-     
      if (Hiscore < points) {
        morewait();
        mprint("Yow! A new high score!");
        morewait();
!       fprintf(fd,"%s\n",Player.name);
!       fprintf(fd,"%s\n",descrip);
! #ifndef MSDOS
!       fprintf(fd,"%d\n",points);
! #else
!       fprintf(fd,"%ld\n",points);
! #endif
!       fprintf(fd,"%d\n",Player.level);
!       fprintf(fd,"%d\n",behavior);
      }
-     else {
-       fprintf(fd,"%s\n",Hiscorer);
-       fprintf(fd,"%s\n",Hidescrip);
- #ifndef MSDOS
-       fprintf(fd,"%d\n",Hiscore);
- #else
-       fprintf(fd,"%ld\n",Hiscore);
- #endif
-       fprintf(fd,"%d\n",Hilevel);
-       fprintf(fd,"%d\n",Hibehavior);
-     }
- 
- 
- 
      if (Player.alignment < Chaos) {
        morewait();
        mprint("Criminy! A new Lord of Chaos!");
        morewait();
!       fprintf(fd,"%s\n",Player.name);
!       fprintf(fd,"%d\n",Player.level);
!       fprintf(fd,"%d\n",Player.alignment);
!       fprintf(fd,"%d\n",behavior);
      }
-     else {
-       fprintf(fd,"%s\n",Chaoslord);
-       fprintf(fd,"%d\n",Chaoslordlevel);
-       fprintf(fd,"%d\n",Chaos);
-       fprintf(fd,"%d\n",Chaoslordbehavior);
-     }
- 
- 
- 
- 
- 
- 
      if (Player.alignment > Law) {
        morewait();
        mprint("Gosh! A new Lord of Law!");
        morewait();
!       fprintf(fd,"%s\n",Player.name);
!       fprintf(fd,"%d\n",Player.level);
!       fprintf(fd,"%d\n",Player.alignment);
!       fprintf(fd,"%d\n",behavior);
      }
!     else {
!       fprintf(fd,"%s\n",Lawlord);
!       fprintf(fd,"%d\n",Lawlordlevel);
!       fprintf(fd,"%d\n",Law);
!       fprintf(fd,"%d\n",Lawlordbehavior);
!     }
  
  
! 
! 
      fprintf(fd,"%s",Duke);
      fprintf(fd,"\n%d",Dukelevel);
!     if (Player.rank[NOBILITY] == DUKE)
!       fprintf(fd,"\n%d",behavior);
!     else fprintf(fd,"\n%d",Dukebehavior);
      fprintf(fd,"\n%s",Justiciar);
      fprintf(fd,"\n%d",Justiciarlevel);
!     if (Player.rank[ORDER] == JUSTICIAR)
!       fprintf(fd,"\n%d",behavior);
!     else fprintf(fd,"\n%d",Justiciarbehavior);
      fprintf(fd,"\n%s",Commandant);
      fprintf(fd,"\n%d",Commandantlevel);
!     if (Player.rank[LEGION] == COMMANDANT)
!       fprintf(fd,"\n%d",behavior);
!     else fprintf(fd,"\n%d",Commandantbehavior);
      fprintf(fd,"\n%s",Champion);
      fprintf(fd,"\n%d",Championlevel);
!     if (Player.rank[ARENA] == CHAMPION)
!       fprintf(fd,"\n%d",behavior);
!     else fprintf(fd,"\n%d",Championbehavior);
      fprintf(fd,"\n%s",Archmage);
      fprintf(fd,"\n%d",Archmagelevel);
!     if (Player.rank[COLLEGE] == ARCHMAGE)
!       fprintf(fd,"\n%d",behavior);
!     else fprintf(fd,"\n%d",Archmagebehavior);
      fprintf(fd,"\n%s",Prime);
      fprintf(fd,"\n%d",Primelevel);
!     if (Player.rank[CIRCLE] == PRIME)
!       fprintf(fd,"\n%d",behavior);
!     else fprintf(fd,"\n%d",Primebehavior);
      fprintf(fd,"\n%s",Shadowlord);
      fprintf(fd,"\n%d",Shadowlordlevel);
!     if (Player.rank[THIEVES] == SHADOWLORD)
!       fprintf(fd,"\n%d",behavior);
!     else fprintf(fd,"\n%d",Shadowlordbehavior);
      for(i=1;i<7;i++) {
        fprintf(fd,"\n%s",Priest[i]);
        fprintf(fd,"\n%d",Priestlevel[i]);
!       if ((Player.rank[PRIESTHOOD] == HIGHPRIEST) && (Player.patron == i))
! 	fprintf(fd,"\n%d",behavior);
!       else fprintf(fd,"\n%d",Priestbehavior[i]);
      }
      fprintf(fd,"\n");
      fclose(fd);
--- 321,414 ----
    int i;
    long points;
  #endif
  
    if (FixedPoints > 0) points = FixedPoints;
    else points = calc_points();
  
    if (! gamestatusp(CHEATED)) {
      if (Hiscore < points) {
        morewait();
        mprint("Yow! A new high score!");
        morewait();
!       strcpy(Hiscorer,Player.name);
!       strcpy(Hidescrip,descrip);
!       Hiscore = points;
!       Hilevel = Player.level;
!       Hibehavior = behavior;
      }
      if (Player.alignment < Chaos) {
        morewait();
        mprint("Criminy! A new Lord of Chaos!");
        morewait();
!       strcpy(Chaoslord,Player.name);
!       Chaoslordlevel = Player.level;
!       Chaos = Player.alignment;
!       Chaoslordbehavior = behavior;
      }
      if (Player.alignment > Law) {
        morewait();
        mprint("Gosh! A new Lord of Law!");
        morewait();
!       strcpy(Lawlord,Player.name);
!       Lawlordlevel = Player.level;
!       Law = Player.alignment;
!       Lawlordbehavior = behavior;
      }
!   }
! }
  
+ /* saves the high score file in a normal fashion */
+ void savescores()
+ {
+   int i;
+   FILE *fd;
  
!   if (!gamestatusp(CHEATED)) {
!     strcpy(Str1,OMEGALIB);
!     strcat(Str1,"omega.hi");
!     fd = checkfopen(Str1,"w");
!     fprintf(fd,"%s\n",Hiscorer);
!     fprintf(fd,"%s\n",Hidescrip);
! #ifndef MSDOS
!     fprintf(fd,"%d\n",Hiscore);
! #else
!     fprintf(fd,"%ld\n",Hiscore);
! #endif
!     fprintf(fd,"%d\n",Hilevel);
!     fprintf(fd,"%d\n",Hibehavior);
!     fprintf(fd,"%s\n",Chaoslord);
!     fprintf(fd,"%d\n",Chaoslordlevel);
!     fprintf(fd,"%d\n",Chaos);
!     fprintf(fd,"%d\n",Chaoslordbehavior);
!     fprintf(fd,"%s\n",Lawlord);
!     fprintf(fd,"%d\n",Lawlordlevel);
!     fprintf(fd,"%d\n",Law);
!     fprintf(fd,"%d\n",Lawlordbehavior);
      fprintf(fd,"%s",Duke);
      fprintf(fd,"\n%d",Dukelevel);
!     fprintf(fd,"\n%d",Dukebehavior);
      fprintf(fd,"\n%s",Justiciar);
      fprintf(fd,"\n%d",Justiciarlevel);
!     fprintf(fd,"\n%d",Justiciarbehavior);
      fprintf(fd,"\n%s",Commandant);
      fprintf(fd,"\n%d",Commandantlevel);
!     fprintf(fd,"\n%d",Commandantbehavior);
      fprintf(fd,"\n%s",Champion);
      fprintf(fd,"\n%d",Championlevel);
!     fprintf(fd,"\n%d",Championbehavior);
      fprintf(fd,"\n%s",Archmage);
      fprintf(fd,"\n%d",Archmagelevel);
!     fprintf(fd,"\n%d",Archmagebehavior);
      fprintf(fd,"\n%s",Prime);
      fprintf(fd,"\n%d",Primelevel);
!     fprintf(fd,"\n%d",Primebehavior);
      fprintf(fd,"\n%s",Shadowlord);
      fprintf(fd,"\n%d",Shadowlordlevel);
!     fprintf(fd,"\n%d",Shadowlordbehavior);
      for(i=1;i<7;i++) {
        fprintf(fd,"\n%s",Priest[i]);
        fprintf(fd,"\n%d",Priestlevel[i]);
!       fprintf(fd,"\n%d",Priestbehavior[i]);
      }
      fprintf(fd,"\n");
      fclose(fd);
***************
*** 452,458 ****
--- 425,433 ----
    strcpy(username,getlogin());
    if ((Player.level > 0) && (! gamestatusp(CHEATED))) {
      npcbehavior=fixnpc(lifestatus);
+     loadscores();
      checkhigh(descrip,npcbehavior);
+     savescores();
      strcpy(Str1,OMEGALIB);
      strcat(Str1,"omega.log");
      fd = checkfopen(Str1,"a");
*** o/oguild2.c	Sat Aug 19 01:35:50 1989
--- oguild2.c	Thu Aug 24 16:16:24 1989
***************
*** 27,34 ****
--- 27,36 ----
        print2("You are now the Shadowlord of the Thieves' Guild!");
        morewait();
        print1("Who says there's no honor among thieves?");
+       loadscores();
        strcpy(Shadowlord,Player.name);
        Shadowlordlevel = Player.level;
+       savescores();
        morewait();
        clearmsg();
        print1("You learn the Spell of Shadowform.");
***************
*** 205,211 ****
  	      mnumprint(2 * item_value(Player.possessions[i]) / 3);
  	      nprint1("Au each. OK? [yn] ");
  	      if (ynq1() == 'y') {
! 		number = getnumber(Player.possessions[i]->number);
  		if ((number >= Player.possessions[i]->number) &&
  		    Player.possessions[i]->used) {
  		  Player.possessions[i]->used = FALSE;
--- 207,213 ----
  	      mnumprint(2 * item_value(Player.possessions[i]) / 3);
  	      nprint1("Au each. OK? [yn] ");
  	      if (ynq1() == 'y') {
! 		number = get_item_number(Player.possessions[i]);
  		if ((number >= Player.possessions[i]->number) &&
  		    Player.possessions[i]->used) {
  		  Player.possessions[i]->used = FALSE;
***************
*** 227,233 ****
  		mnumprint(2*item_value(Player.pack[i])/3);
  		nprint1("Au each? [ynq] ");
  		if ((c=ynq1())=='y') {
! 		  number = getnumber(Player.pack[i]->number);
  		  Player.cash += 2*number * item_value(Player.pack[i]) / 3;
  		  Player.pack[i]->number -= number;
  		  if (Player.pack[i]->number < 1) {
--- 229,235 ----
  		mnumprint(2*item_value(Player.pack[i])/3);
  		nprint1("Au each? [ynq] ");
  		if ((c=ynq1())=='y') {
! 		  number = get_item_number(Player.pack[i]);
  		  Player.cash += 2*number * item_value(Player.pack[i]) / 3;
  		  Player.pack[i]->number -= number;
  		  if (Player.pack[i]->number < 1) {
***************
*** 266,273 ****
--- 268,277 ----
  	print2("The Board of Trustees appoints you Archmage!");
  	morewait();
  	clearmsg();
+ 	loadscores();
  	strcpy(Archmage,Player.name);
  	Archmagelevel = Player.level;
+ 	savescores();
  	Player.rank[COLLEGE] = ARCHMAGE;
  	Player.maxiq += 5;
  	Player.iq += 5;
***************
*** 448,455 ****
--- 452,461 ----
        morewait();
        print1("The Crown is ritually sacrificed to the Lords of Chaos.");
        print2("You are now the Prime Sorceror of the Inner Circle!");
+       loadscores();
        strcpy(Prime,Player.name);
        Primelevel = Player.level;
+       savescores();
        morewait();
        clearmsg();
        print1("You learn the Spell of Disintegration!");
***************
*** 616,623 ****
--- 622,631 ----
      morewait();
      print1("The previous Justiciar steps down in your favor.");
      print2("You are now the Justiciar of Rampart and the Order!");
+     loadscores();
      strcpy(Justiciar,Player.name);
      Justiciarlevel = Player.level;
+     savescores();
      morewait();
      clearmsg();
      print1("You are awarded a blessed shield of deflection!");
*** o/oinv.c	Sat Aug 19 13:49:07 1989
--- oinv.c	Sat Aug 19 15:24:04 1989
***************
*** 718,724 ****
  
  void inventory_control()
  {
!   int slot = 0,done=FALSE;
  #ifndef MSDOS
    char response;
  #else
--- 718,724 ----
  
  void inventory_control()
  {
!   int slot = 0, done = FALSE, uiaflag = FALSE, slotflag = FALSE;
  #ifndef MSDOS
    char response;
  #else
***************
*** 729,740 ****
    do {
      checkclear();
      print1("Action [^l,d,e,p,s,t,x,>,<,?,ESCAPE]:");
!     display_inventory_slot(slot,FALSE);
!     if (slot == O_WEAPON_HAND)
!       display_inventory_slot(O_READY_HAND,FALSE);
!     else if (slot == O_READY_HAND)
!       display_inventory_slot(O_WEAPON_HAND,FALSE);
!     display_inventory_slot(O_UP_IN_AIR,FALSE);
      move_slot(slot,slot,MAXITEMS);
      response = mcigetc();
  
--- 729,746 ----
    do {
      checkclear();
      print1("Action [^l,d,e,p,s,t,x,>,<,?,ESCAPE]:");
!     if (slotflag) {
!       display_inventory_slot(slot,FALSE);
!       if (slot == O_WEAPON_HAND)
! 	display_inventory_slot(O_READY_HAND,FALSE);
!       else if (slot == O_READY_HAND)
! 	display_inventory_slot(O_WEAPON_HAND,FALSE);
!       slotflag = FALSE;
!     }
!     if (uiaflag) {
!       display_inventory_slot(O_UP_IN_AIR,FALSE);
!       uiaflag = FALSE;
!     }
      move_slot(slot,slot,MAXITEMS);
      response = mcigetc();
  
***************
*** 745,760 ****
        display_possessions();
        break;
      case 'd':
!       if (Player.possessions[O_UP_IN_AIR] != NULL) 
  	drop_from_slot(O_UP_IN_AIR);
!       else if (Player.possessions[slot] != NULL) 
  	drop_from_slot(slot);
        else print3("Nothing in selected slot!");
        Command_Duration++;
        break; 
      case 'p': 
!       if (Player.possessions[slot] != NULL) 
  	put_to_pack(slot);
        Command_Duration+=5;
        break;
      case 's':
--- 751,772 ----
        display_possessions();
        break;
      case 'd':
!       if (Player.possessions[O_UP_IN_AIR] != NULL) {
  	drop_from_slot(O_UP_IN_AIR);
! 	uiaflag = TRUE;
!       }
!       else if (Player.possessions[slot] != NULL) {
  	drop_from_slot(slot);
+ 	slotflag = TRUE;
+       }
        else print3("Nothing in selected slot!");
        Command_Duration++;
        break; 
      case 'p': 
!       if (Player.possessions[slot] != NULL) {
  	put_to_pack(slot);
+ 	slotflag = TRUE;
+       }
        Command_Duration+=5;
        break;
      case 's':
***************
*** 767,781 ****
--- 779,798 ----
      case 't': 
        take_from_pack(slot,TRUE); 
        Command_Duration+=5;
+       slotflag = TRUE;
        break;
      case 'e':
        switch_to_slot(slot);
        Command_Duration+=2;
+       uiaflag = TRUE;
+       slotflag = TRUE;
        break;
      case 'x':
        switch_to_slot(slot);
        Command_Duration+=2;
        done = (Player.possessions[O_UP_IN_AIR] == NULL);
+       uiaflag = TRUE;
+       slotflag = TRUE;
        break;
      case 'j':
      case '>':
***************
*** 939,944 ****
--- 956,962 ----
  pob o;
  {
    int n=0;
+   if (o->number == 1) return(1);
    do {
      print1("How many? -- max");
      mnumprint(o->number);
*** o/osave.c	Fri Aug 18 21:21:22 1989
--- osave.c	Thu Aug 24 15:21:49 1989
***************
*** 404,410 ****
    strcat(cmd,savestr);
    system(cmd);
    print2("Save file uncompressed.");
-   morewait();
    if ((savestr[strlen(savestr)-1] == 'Z') &&
        (savestr[strlen(savestr)-2] == '.'))
      savestr[strlen(savestr)-2] = 0;
--- 404,409 ----
***************
*** 575,580 ****
--- 574,581 ----
    fread((char *)&Lawlordlevel,sizeof(Lawlordlevel),1,fd);
    fread((char *)&Chaos,sizeof(Chaos),1,fd);
    fread((char *)&Law,sizeof(Law),1,fd);
+ 
+   loadscores();
  
    /* stuff which used to be statics */
    fread((char *)&twiddle,sizeof(twiddle),1,fd);
*** o/oscr.c	Thu Aug 24 15:01:55 1989
--- oscr.c	Thu Aug 24 15:04:13 1989
***************
*** 314,320 ****
    /* Pseudo Random Seed */
    Seed = (int) time((long *)NULL);
    clear();
!   refresh();  
    showscores();
  }
  
--- 314,321 ----
    /* Pseudo Random Seed */
    Seed = (int) time((long *)NULL);
    clear();
!   refresh();
!   loadscores();
    showscores();
  }
  
*** o/osite1.c	Mon Aug 14 22:29:52 1989
--- osite1.c	Sun Aug 20 21:51:51 1989
***************
*** 395,402 ****
        for(j=0;j<LENGTH;j++) {
  	lset(i,j,SEEN);
  	lreset(i,j,SECRET);
- 	show_screen();
        }
      break;
    }
  }
--- 395,402 ----
        for(j=0;j<LENGTH;j++) {
  	lset(i,j,SEEN);
  	lreset(i,j,SECRET);
        }
+     show_screen();
      break;
    }
  }
***************
*** 918,924 ****
  	    adeptfile();
  	  }
  	  else if (response == 'e') {
! 	    if (random_range(30) > Player.iq)  {
  	      print1("You feel more knowledgeable!");
  	      Player.iq++;
  	      Player.maxiq++;
--- 918,924 ----
  	    adeptfile();
  	  }
  	  else if (response == 'e') {
! 	    if (random_range(30) >= Player.iq)  {
  	      print1("You feel more knowledgeable!");
  	      Player.iq++;
  	      Player.maxiq++;
***************
*** 1024,1030 ****
  	    mnumprint(item_value(Player.possessions[i]) / 2);
  	    nprint1("Au each. Sell [yn]? ");
  	    if (ynq1() == 'y') {
! 	      number = getnumber(Player.possessions[i]->number);
  	      if ((number >= Player.possessions[i]->number) &&
  		  Player.possessions[i]->used) {
  		Player.possessions[i]->used = FALSE;
--- 1024,1030 ----
  	    mnumprint(item_value(Player.possessions[i]) / 2);
  	    nprint1("Au each. Sell [yn]? ");
  	    if (ynq1() == 'y') {
! 	      number = get_item_number(Player.possessions[i]);
  	      if ((number >= Player.possessions[i]->number) &&
  		  Player.possessions[i]->used) {
  		Player.possessions[i]->used = FALSE;
***************
*** 1053,1059 ****
  	    mnumprint(item_value(Player.pack[i])/2);
  	    nprint1("Au each? [yn] ");
  	    if (ynq1()=='y') {
! 	      number = getnumber(Player.pack[i]->number);
  	      if (number > 0) {
  		Player.cash += number * item_value(Player.pack[i]) / 2;
  		free((char *) Pawnitems[0]);
--- 1053,1059 ----
  	    mnumprint(item_value(Player.pack[i])/2);
  	    nprint1("Au each? [yn] ");
  	    if (ynq1()=='y') {
! 	      number = get_item_number(Player.pack[i]);
  	      if (number > 0) {
  		Player.cash += number * item_value(Player.pack[i]) / 2;
  		free((char *) Pawnitems[0]);