$NetBSD: patch-bb,v 1.1.1.1 2001/04/27 15:27:31 agc Exp $

--- store.c.orig	Fri Jun 19 13:55:37 1992
+++ store.c	Sat Jan 13 21:56:25 2001
@@ -1,4 +1,5 @@
 /*	store.c		*/
+#include <stdlib.h>
 #include "header.h"
 #include "player.h"
 #include "itm.h"
@@ -136,14 +137,14 @@
 /*
 	function for the dnd store
  */
-dnd_2hed()
+void dnd_2hed(void)
 {
 lprcat("Welcome to the Ularn Thrift Shoppe.  We stock many items explorers find useful\n");
 lprcat("in their adventures.  Feel free to browse to your hearts content.\n");
 lprcat("Also be advised, if you break 'em, you pay for 'em.");
 }
 
-dnd_hed()
+void dnd_hed(void)
 {
 	int i;
 
@@ -153,13 +154,13 @@
 	lprcat("You have ");
 }
 
-dndstore()
+void dndstore(void)
 {
 	int i;
 
 	dnditm = 0;
 	nosignal = 1; /* disable signals */
-	clear();
+	ularn_clear();
 	dnd_2hed();
 	if (outstanding_taxes>0) {
 lprcat("\n\nThe Ularn Revenue Service has ordered us to not do business with tax evaders.\n");
@@ -192,7 +193,7 @@
 		while ((i<'a' || i>'z') && (i!=' ') && (i!=ESC) && (i!=12))
 			i=getcharacter();
 		if (i==12) {
-			clear();
+			ularn_clear();
 			dnd_2hed();
 			dnd_hed();
 		}
@@ -238,19 +239,21 @@
 /*
 	function for the players hands are full
  */
-handsfull()
+void handsfull(void)
 {
 	lprcat("\nYou can't carry anything more!");
 	lflush();
 	nap(2200);
 }
-outofstock()
+
+void outofstock(void)
 {
 	lprcat("\nSorry, but we are out of that item.");
 	lflush();
 	nap(2200);
 }
-nogold()
+
+void nogold(void)
 {
 	lprcat("\nYou don't have enough gold to pay for that!");
 	lflush();
@@ -263,7 +266,7 @@
 	to print the item list;
 	used in dndstore() enter with the index into itm
 */
-dnditem(i)
+void dnditem(i)
 int i;
 {
 	int j,k;
@@ -281,11 +284,11 @@
 	lprintf("%c) ",(i%IVENSIZE)+'a');
 	if (itm[i].obj == OPOTION) {
 		lprcat("potion of ");
-		lprintf("%s",&potionname[itm[i].arg][1]);
+		lprintf("%s",potionname[itm[i].arg]);
 	}
 	else if (itm[i].obj == OSCROLL) {
 		lprcat("scroll of ");
-		lprintf("%s",&scrollname[itm[i].arg][1]);
+		lprintf("%s",scrollname[itm[i].arg]);
 	}
 	else lprintf("%s",objectname[itm[i].obj]);
 	cursor( j+31,k );
@@ -302,9 +305,9 @@
 /*
 	function to display the header info for the school
  */
-sch_hed()
+void sch_hed(void)
 {
-	clear();
+	ularn_clear();
 lprcat("The College of Ularn offers the exciting opportunity of higher education to\n");
 lprcat("all inhabitants of the caves.  Here is a list of the class schedule:\n\n\n");
 	lprcat("\t\t    Course Name \t       Time Needed\n\n");
@@ -339,7 +342,7 @@
 	lprcat("You are presently carrying ");
 }
 
-oschool()
+void oschool(void)
 {
 	int i;
 
@@ -470,20 +473,21 @@
  *	for the first national bank of Ularn
  */
 long lasttime=0;	/* last time he was in bank */
-obank()
+void obank(void)
 {
 	banktitle("    Welcome to the First National Bank of Ularn.");
 }
-obank2()
+
+void obank2(void)
 {
 banktitle("Welcome to the 8th level branch office of the First National Bank of Ularn.");
 }
 
-banktitle(str)
+void banktitle(str)
 char *str;
 {
 	nosignal = 1; /* disable signals */
-	clear();
+	ularn_clear();
 	lprcat(str);
 	if (outstanding_taxes>0) {
 		int i;
@@ -517,7 +521,7 @@
  *	limit of 1 million gold pieces in bank
  */
 #define BANKLIMIT 1000000
-ointerest()
+void ointerest(void)
 {
 	int i;
 
@@ -537,7 +541,7 @@
 static  short gemorder[IVENSIZE]={0};	/* the reference to screen location for each */
 static long gemvalue[IVENSIZE]={0};	/* the appraisal of the gems */
 
-obanksub()
+void obanksub(void)
 {
 	long amt;
 	int i,k, eye=0;
@@ -674,7 +678,7 @@
 	}
 }
 
-appraise(eye, order)
+void appraise(eye, order)
 int eye, order;
 {
 	long amt;
@@ -710,9 +714,9 @@
 /*
 	function for the trading post
  */
-otradhead()
+void otradhead(void)
 {
-	clear();
+	ularn_clear();
 lprcat("Welcome to the Ularn Trading Post.  We buy items that explorers no longer find\n");
 lprcat("useful.  Since the condition of the items you bring in is not certain,\n");
 lprcat("and we incur great expense in reconditioning the items, we usually pay\n");
@@ -720,7 +724,7 @@
 lprcat("damaged, we will pay only 10% of their new value.\n\n");
 }
 
-otradepost()
+void otradepost(void)
 {
 	int i,j,isub,izarg;
 	long value;
@@ -748,12 +752,12 @@
 		isub = i - 'a';
 		j=0;
 		if (iven[isub]==OSCROLL)
-			if (scrollname[ivenarg[isub]][0]==0) {
+			if (scrollknown[ivenarg[isub]]==0) {
 				j=1;
 				cnsitm();
 			}	/* can't sell unidentified item */
 		if (iven[isub]==OPOTION)
-			if (potionname[ivenarg[isub]][0]==0) {
+			if (potionknown[ivenarg[isub]]==0) {
 				j=1;
 				cnsitm();
 			}	/* can't sell unidentified item */
@@ -761,9 +765,9 @@
 			j=1;
 			lprcat("\nYou don't *really* want to sell that, now do you?");
 		}
-		if (!j)
+		if (!j) {
 			if (i=='*') {
-				clear();
+				ularn_clear();
 				qshowstr();
 				otradhead();
 			}
@@ -814,10 +818,11 @@
 				if (j <= DNDSIZE+2)
 					lprcat("\nSo sorry, but we are not authorized to accept that item.");
 			}
+		}
 	}
 }
 
-cnsitm()
+void cnsitm(void)
 {
 	lprcat("\nSorry, we can't accept unidentified objects.");
 }
@@ -825,13 +830,13 @@
 /*
  *	for the Ularn Revenue Service
  */
-olrs()
+void olrs(void)
 {
 	int i,first;
 	long amt;
 
 	first = nosignal = 1; /* disable signals */
-	clear();
+	ularn_clear();
 	resetscroll();
 	cursor(1,4);
 	if (outstanding_taxes)
@@ -899,13 +904,14 @@
 }
 
 
-nomore()
+void nomore(void)
 {
 	lprcat("\nSorry man, I ain't got no more of that shit.");
 	lflush();
 	nap(2200);
 }
-nocash()
+
+void nocash(void)
 {
 	lprcat("\nWhattaya trying to pull on me? You aint got the cash!");
 	lflush();
@@ -919,9 +925,9 @@
 	function to display the header info for the pad
  */
 char drug[5]={0};
-pad_hd()
+void pad_hd(void)
 {
-	clear();
+	ularn_clear();
 	lprcat("Hey man, welcome to Dealer McDope's Pad!  I gots the some of the finest shit\n");
 	lprcat("you'll find anywhere in Ularn - check it out...\n\n\n");
 	lprcat("\t\t    The Stash\t\t\tThe Cash\n\n");
@@ -942,7 +948,7 @@
 	lprcat("Looks like you got about ");
 }
 
-opad()
+void opad(void)
 {
 	int i,flag;
 
@@ -1061,7 +1067,7 @@
 	} /*end while(1) */
 } /* end pad() */
 
-snag(itm)
+int snag(itm)
 int itm;
 {
 	int i,limit;
@@ -1082,7 +1088,7 @@
 	return(0);
 }
 
-pick_char(foo)
+void pick_char(foo)
 int foo;
 {
 	int i;
@@ -1090,7 +1096,7 @@
 	nosignal = 1; /* disable signals */
 
     	if (foo == 0) {
-		clear();
+		ularn_clear();
 		lprcat("\t\tThe Addiction of Ularn\n\n");
 		lprcat("Pick a character class...\n\n\n");
 		lprcat("\t\t    Character\n\n");
