summaryrefslogtreecommitdiff
path: root/games/ularn/patches/patch-ax
blob: fc3cbf6358377110d8a179b31cac7f51303133b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
$NetBSD: patch-ax,v 1.1.1.1 2001/04/27 15:27:31 agc Exp $

--- scores.c.orig	Fri Jun 19 13:55:34 1992
+++ scores.c	Sat Jan 13 21:55:18 2001
@@ -33,6 +33,7 @@
  *	diedsub(x) 
  *		Subroutine to print out a line showing player when he is killed
  */
+#include <unistd.h>
 #include "header.h"
 #include "monst.h"
 #include "itm.h"
@@ -109,7 +110,7 @@
  *
  *	returns -1 if unable to read in the scoreboard, returns 0 if all is OK
  */
-readboard()
+int readboard(void)
 {
 	FILE *fp;
 
@@ -142,7 +143,7 @@
  *
  *	returns -1 if unable to write the scoreboard, returns 0 if all is OK
  */
-writeboard()
+int writeboard(void)
 {
 	FILE *fp;
 
@@ -175,7 +176,7 @@
  *
  *	returns -1 if unable to write the scoreboard, returns 0 if all is OK
  */
-makeboard()
+int makeboard(void)
 {
 	int	i;
 
@@ -200,7 +201,7 @@
  *	scoreboard.  This function also sets outstanding_taxes to the value in
  *	the winners scoreboard.
  */
-hashewon()
+int hashewon(void)
 {
 	int	i;
 
@@ -263,7 +264,7 @@
  *
  *	Returns the number of players on scoreboard that were shown 
  */
-winshou()
+int winshou(void)
 {
 	struct wscofmt *p;
 	int	i, j, count;
@@ -312,7 +313,7 @@
  *	Enter with 0 to list the scores, enter with 1 to list inventories too
  *	Returns the number of players on scoreboard that were shown 
  */
-shou(x)
+int shou(x)
 int	x;
 {
 	int	i, j, n;
@@ -385,7 +386,7 @@
  */
 static char	esb[] = "The scoreboard is empty.\n";
 
-showscores()
+void showscores(void)
 {
 	int	i, j;
 
@@ -408,7 +409,7 @@
  *
  *	Returns nothing of value
  */
-showallscores()
+void showallscores(void)
 {
 	int	i, j;
 
@@ -419,9 +420,9 @@
 	c[WEAR] = c[WIELD] = c[SHIELD] = -1;
 
 	for (i = 0; i < MAXPOTION; i++) 
-		potionname[i][0] = ' ';
+		potionknown[i] = 1;
 	for (i = 0; i < MAXSCROLL; i++) 
-		scrollname[i][0] = ' ';
+		scrollknown[i] = 1;
 
 	i = winshou();  
 	j = shou(1);
@@ -439,7 +440,7 @@
  *
  *	Returns 0 if no sorting done, else returns 1
  */
-sortboard()
+int sortboard(void)
 {
 	int	i, j, pos;
 	long	jdat;
@@ -480,7 +481,7 @@
  *		died() reason # in whyded, and TRUE/FALSE in winner if a winner
  *	ex.		newscore(1000, "player 1", 32, 0);
  */
-newscore(score, whoo, whyded, winner)
+void newscore(score, whoo, whyded, winner)
 long	score;
 int	winner, whyded;
 char	*whoo;
@@ -544,7 +545,7 @@
  *		slot in scoreboard in i, and the tax bill in taxes.
  *	Returns nothing of value
  */
-new1sub(score, i, whoo, taxes)
+void new1sub(score, i, whoo, taxes)
 long	score, taxes;
 int	i;
 char	*whoo;
@@ -576,7 +577,7 @@
  *		died() reason # in whyded, and slot in scoreboard in i.
  *	Returns nothing of value
  */
-new2sub(score, i, whoo, whyded)
+void new2sub(score, i, whoo, whyded)
 long	score;
 int	i, whyded;
 char	*whoo;
@@ -649,7 +650,7 @@
 
 static int	scorerror;
 
-died(x)
+void died(x)
 int	x;
 {
 	int	f, win;
@@ -710,7 +711,7 @@
 	/*	now enter the player at the end of the scoreboard */
 	newscore(c[GOLD] + c[BANKACCOUNT], logname, x, win);
 
-	clear();
+	ularn_clear();
 	lflush();
 	diedsub(x);	/* print out the score line */
 
@@ -743,7 +744,7 @@
  *	diedsub(x) 
  *	int x;
  */
-diedsub(x)
+void diedsub(x)
 int	x;
 {
 	char	ch, *mod, *cls;
@@ -753,7 +754,7 @@
 	puts("---------------------------------------------------------------");
 	puts("                 U L A R N    S C O R E S");
 	puts("---------------------------------------------------------------");
-	printf("Score: %ld  Diff: %d  ", c[GOLD], c[HARDGAME]);
+	printf("Score: %ld  Diff: %ld  ", c[GOLD], c[HARDGAME]);
 	printf("Level: %s  Char: %s\n", cls, char_class);
 	printf("\t%s", logname);
 	if (wizard) 
@@ -788,7 +789,7 @@
 	fflush(stdout);
 }
 
-showscore3(index)
+void showscore3(index)
 int	index;
 {
 	switch (iven[index]) {
@@ -820,9 +821,9 @@
 	default:
 		printf("\n%c)   %s", index + 'a' , objectname[iven[index]]);
 		if (ivenarg[index] > 0)
-			printf(" + %d", (long)ivenarg[index]);
+			printf(" + %ld", (long)ivenarg[index]);
 		else if (ivenarg[index] < 0)
-			printf(" %d", (long)ivenarg[index]);
+			printf(" %ld", (long)ivenarg[index]);
 		break;
 	}
 	if (c[WIELD] == index) 
@@ -832,7 +833,7 @@
 	fflush(stdout);
 }
 
-showscore1(idx, str2)
+void showscore1(idx, str2)
 int	idx;
 char	*str2[];
 {