-/* $NetBSD: hack.worm.c,v 1.5 2003/04/02 18:36:41 jsm Exp $ */
+/* $NetBSD: hack.worm.c,v 1.9 2011/08/06 20:29:37 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.worm.c,v 1.5 2003/04/02 18:36:41 jsm Exp $");
+__RCSID("$NetBSD: hack.worm.c,v 1.9 2011/08/06 20:29:37 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
struct wseg *wheads[32];
long wgrowtime[32];
+static void remseg(struct wseg *);
+
int
-getwn(mtmp)
- struct monst *mtmp;
+getwn(struct monst *mtmp)
{
int tmp;
for (tmp = 1; tmp < 32; tmp++)
/* called to initialize a worm unless cut in half */
void
-initworm(mtmp)
- struct monst *mtmp;
+initworm(struct monst *mtmp)
{
struct wseg *wtmp;
int tmp = mtmp->wormno;
}
void
-worm_move(mtmp)
- struct monst *mtmp;
+worm_move(struct monst *mtmp)
{
struct wseg *wtmp, *whd = NULL;
int tmp = mtmp->wormno;
}
void
-worm_nomove(mtmp)
- struct monst *mtmp;
+worm_nomove(struct monst *mtmp)
{
int tmp;
struct wseg *wtmp;
}
void
-wormdead(mtmp)
- struct monst *mtmp;
+wormdead(struct monst *mtmp)
{
int tmp = mtmp->wormno;
struct wseg *wtmp, *wtmp2;
}
void
-wormhit(mtmp)
- struct monst *mtmp;
+wormhit(struct monst *mtmp)
{
int tmp = mtmp->wormno;
struct wseg *wtmp;
}
void
-wormsee(tmp)
- unsigned tmp;
+wormsee(unsigned tmp)
{
struct wseg *wtmp = wsegs[tmp];
if (!wtmp)
}
void
-pwseg(wtmp)
- struct wseg *wtmp;
+pwseg(struct wseg *wtmp)
{
if (!wtmp->wdispl) {
atl(wtmp->wx, wtmp->wy, '~');
}
}
+/* weptyp is uwep->otyp or 0 */
void
-cutworm(mtmp, x, y, weptyp)
- struct monst *mtmp;
- xchar x, y;
- uchar weptyp; /* uwep->otyp or 0 */
+cutworm(struct monst *mtmp, xchar x, xchar y, uchar weptyp)
{
struct wseg *wtmp, *wtmp2;
struct monst *mtmp2;
} else {
pline("You cut off part of the worm's tail.");
remseg(wtmp);
+ monfree(mtmp2);
}
mtmp->mhp /= 2;
return;
panic("Cannot find worm segment");
}
-void
-remseg(wtmp)
- struct wseg *wtmp;
+static void
+remseg(struct wseg *wtmp)
{
if (wtmp->wdispl)
newsym(wtmp->wx, wtmp->wy);
- free((char *) wtmp);
+ free(wtmp);
}
#endif /* NOWORM */