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
|
$NetBSD: patch-ar,v 1.1.1.1 2001/04/27 15:27:32 agc Exp $
--- movem.c.orig Fri Jun 19 13:55:34 1992
+++ movem.c Sat Jan 13 20:33:43 2001
@@ -10,6 +10,7 @@
* mmove(x,y,xd,yd)
* Function to actually perform the monster movement
*/
+#include <stdlib.h>
#include "header.h"
#include "sphere.h"
#include "monst.h"
@@ -26,7 +27,7 @@
*/
static short w1[9],w1x[9],w1y[9];
static int tmp1,tmp2,tmp3,tmp4,distance;
-movemonst()
+void movemonst(void)
{
int i,j;
@@ -115,7 +116,7 @@
*/
static int tmpitem,xl,xh,yl,yh;
-movemt(i,j)
+void movemt(i,j)
int i,j;
{
int k,m,z,tmp,xtmp,ytmp,monst;
@@ -294,7 +295,7 @@
* Enter with the from coordinates in (x,y) and the destination coordinates
* in (xd,yd).
*/
-mmove(aa,bb,cc,dd)
+void mmove(aa,bb,cc,dd)
int aa,bb,cc,dd;
{
int tmp,it,i,x,flag;
@@ -372,10 +373,10 @@
hitp[cc][dd]=1;
if (tmp==LEMMING) {
- /* 10% chance moving a lemming creates a new lemming
+ /* 1% chance moving a lemming creates a new lemming
** in the old spot
*/
- if (rnd(100)<=9) {
+ if (rnd(100)==1) {
mitem[aa][bb].mon = LEMMING;
know[aa][bb]=1;
}
@@ -398,7 +399,7 @@
case OEMERALD:
case OSAPPHIRE:
if (mitem[cc][dd].n < 6) {
- char n = mitem[cc][dd].n++;
+ int n = mitem[cc][dd].n++;
mitem[cc][dd].it[n].item = item[cc][dd];
mitem[cc][dd].it[n].itemarg = iarg[cc][dd];
}
@@ -481,7 +482,7 @@
show1cell(cc,dd);
}
-teleportmonst (xx, yy, monst)
+void teleportmonst (xx, yy, monst)
int xx, yy, monst;
{
int i, x,y,trys;
|