Skip to content

Commit 9d197fa

Browse files
author
Alex Smith
committed
Remove dead code for 1-indexing the monster list
Thanks to FIQ for catching this.
1 parent d2454e4 commit 9d197fa

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

libnethack/include/permonst.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* vim:set cin ft=c sw=4 sts=4 ts=8 et ai cino=Ls\:0t0(0 : -*- mode:c;fill-column:80;tab-width:8;c-basic-offset:4;indent-tabs-mode:nil;c-file-style:"k&r" -*-*/
2-
/* Last modified by Alex Smith, 2014-04-05 */
2+
/* Last modified by Alex Smith, 2017-07-15 */
33
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
44
/* NetHack may be freely redistributed. See license for details. */
55

@@ -81,7 +81,7 @@ extern const struct permonst mons[]; /* the master list of monster types */
8181
# define FAST_SPEED 15
8282
# define VERY_FAST 24
8383

84-
# define NON_PM PM_PLAYERMON /* "not a monster" */
84+
# define NON_PM (-1) /* "not a monster" */
8585
# define LOW_PM (NON_PM+1) /* first monster in mons[] */
8686
# define SPECIAL_PM PM_LONG_WORM_TAIL /* [normal] < ~ < [special] */
8787
/* mons[SPECIAL_PM] through mons[NUMMONS-1], inclusive, are never

libnethack/util/makedefs.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* vim:set cin ft=c sw=4 sts=4 ts=8 et ai cino=Ls\:0t0(0 : -*- mode:c;fill-column:80;tab-width:8;c-basic-offset:4;indent-tabs-mode:nil;c-file-style:"k&r" -*-*/
2-
/* Last modified by Alex Smith, 2015-03-21 */
2+
/* Last modified by Alex Smith, 2017-07-15 */
33
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
44
/* Copyright (c) M. Stephenson, 1990, 1991. */
55
/* Copyright (c) Dean Luick, 1990. */
@@ -959,9 +959,6 @@ do_permonst(const char *outfile)
959959
fprintf(ofp, "%s", Dont_Edit_Code);
960960
fprintf(ofp, "#ifndef PM_H\n#define PM_H\n");
961961

962-
if (strcmp(mons[0].mname, "playermon") != 0)
963-
fprintf(ofp, "\n#define\tPM_PLAYERMON\t(-1)");
964-
965962
for (i = 0; mons[i].mlet; i++) {
966963
fprintf(ofp, "\n#define\tPM_");
967964
if (mons[i].mlet == S_HUMAN && !strncmp(mons[i].mname, "were", 4))

0 commit comments

Comments
 (0)