]> granicus.if.org Git - nethack/commitdiff
Merge branch 'NetHack-3.6'
authornhmall <nhmall@nethack.org>
Sat, 16 Nov 2019 22:09:44 +0000 (17:09 -0500)
committernhmall <nhmall@nethack.org>
Sat, 16 Nov 2019 22:09:44 +0000 (17:09 -0500)
1  2 
include/extern.h
src/ball.c
src/do_name.c
src/steed.c

Simple merge
diff --cc src/ball.c
Simple merge
diff --cc src/do_name.c
index 6b5af09a6920a888cced2233bb6a56b590b4bba2,c8965a706e35e08b42f1da7c35e91d00186b975c..999fe2055c4b7e7e5b60eed7c9718754b0e20623
@@@ -1973,8 -1978,44 +1978,8 @@@ struct monst *mon, *other_mon
      return outbuf;
  }
  
 -/* for debugging messages, where data might be suspect and we aren't
 -   taking what the hero does or doesn't know into consideration */
 -char *
 -minimal_monnam(mon, ckloc)
 -struct monst *mon;
 -boolean ckloc;
 -{
 -    struct permonst *ptr;
 -    char *outbuf = nextmbuf();
 -
 -    if (!mon) {
 -        Strcpy(outbuf, "[Null monster]");
 -    } else if ((ptr = mon->data) == 0) {
 -        Strcpy(outbuf, "[Null mon->data]");
 -    } else if (ptr < &mons[0]) {
 -        Sprintf(outbuf, "[Invalid mon->data %s < %s]",
 -                fmt_ptr((genericptr_t) mon->data),
 -                fmt_ptr((genericptr_t) &mons[0]));
 -    } else if (ptr >= &mons[NUMMONS]) {
 -        Sprintf(outbuf, "[Invalid mon->data %s >= %s]",
 -                fmt_ptr((genericptr_t) mon->data),
 -                fmt_ptr((genericptr_t) &mons[NUMMONS]));
 -    } else if (ckloc && ptr == &mons[PM_LONG_WORM]
 -               && level.monsters[mon->mx][mon->my] != mon) {
 -        Sprintf(outbuf, "%s <%d,%d>",
 -                mons[PM_LONG_WORM_TAIL].mname, mon->mx, mon->my);
 -    } else {
 -        Sprintf(outbuf, "%s%s <%d,%d>",
 -                mon->mtame ? "tame " : mon->mpeaceful ? "peaceful " : "",
 -                mon->data->mname, mon->mx, mon->my);
 -        if (mon->cham != NON_PM)
 -            Sprintf(eos(outbuf), "{%s}", mons[mon->cham].mname);
 -    }
 -    return outbuf;
 -}
 -
  /* fake monsters used to be in a hard-coded array, now in a data file */
static char *
STATIC_OVL char *
  bogusmon(buf, code)
  char *buf, *code;
  {
diff --cc src/steed.c
index 942bab8ec2d71c06ccc7559776262f0029b83194,2f09e589684879295db61693311359917c3db093..cc0c165cdbd90baa5df35d916be9cebe72c524bd
@@@ -762,13 -764,15 +764,15 @@@ int x, y
                     mon->mstate, buf);
          return;
      }
-     if (g.level.monsters[x][y]) {
 -    if ((othermon = level.monsters[x][y]) != 0) {
++    if ((othermon = g.level.monsters[x][y]) != 0) {
          describe_level(buf);
-         impossible("placing monster over another at <%d,%d>, mstates:%lx %lx on %s?",
-                     x, y, g.level.monsters[x][y]->mstate, mon->mstate, buf);
+         monnm = minimal_monnam(mon, FALSE);
+         othnm = (mon != othermon) ? minimal_monnam(othermon, TRUE) : "itself";
+         impossible("placing %s over %s at <%d,%d>, mstates:%lx %lx on %s?",
+                    monnm, othnm, x, y, othermon->mstate, mon->mstate, buf);
      }
      mon->mx = x, mon->my = y;
 -    level.monsters[x][y] = mon;
 +    g.level.monsters[x][y] = mon;
      mon->mstate &= ~(MON_OFFMAP | MON_MIGRATING | MON_LIMBO | MON_BUBBLEMOVE
                       | MON_ENDGAME_FREE | MON_ENDGAME_MIGR);
  }