wizard mode #migratemons fixes

Noticed while doing rudimentary testing of the mnearto() fix for
mimics.  #migratemons wouldn't add monsters to migrating_mons if
getlin() was compiled with EDIT_GETLIN defined unless you manually
deleted the invisible default value that wiz_migrate_mons() was
passing.  It took a while to puzzle that one out.

The command list has conditional description of what #migratemons
does and it was using the wrong spelling of the macro used to
control that.  So '# ?' described the behavior of #migratemons as
it operates without DEBUG_MIGRATING_MONS enabled even when that is
enabled, adding to the getlin() confusion.
This commit is contained in:
PatR
2024-05-24 16:23:15 -07:00
parent 3a49b4c463
commit 4217eee07b
2 changed files with 5 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 cmd.c $NHDT-Date: 1710029089 2024/03/10 00:04:49 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.712 $ */
/* NetHack 3.7 cmd.c $NHDT-Date: 1716592962 2024/05/24 23:22:42 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.728 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1725,7 +1725,7 @@ struct ext_func_tab extcmdlist[] = {
{ M('l'), "loot", "loot a box on the floor",
doloot, AUTOCOMPLETE | CMD_M_PREFIX, NULL },
{ '\0', "migratemons",
#ifdef DEBUG_MIGRATING_MONSTERS
#ifdef DEBUG_MIGRATING_MONS
"show migrating monsters and migrate N random ones",
#else
"show migrating monsters",

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 wizcmds.c $NHDT-Date: 1709675219 2024/03/05 21:46:59 $ $NHDT-Branch: keni-mdlib-followup $:$NHDT-Revision: 1.713 $ */
/* NetHack 3.7 wizcmds.c $NHDT-Date: 1716592982 2024/05/24 23:23:02 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.7 $ */
/*-Copyright (c) Robert Patrick Rankin, 2024. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1791,13 +1791,13 @@ wiz_migrate_mons(void)
list_migrating_mons(&tolevel);
#ifdef DEBUG_MIGRATING_MONS
inbuf[0] = '\033', inbuf[1] = '\0';
inbuf[0] = inbuf[1] = '\0';
if (tolevel.dnum || tolevel.dlevel)
getlin("How many random monsters to migrate to next level? [0]",
inbuf);
else
pline("Can't get there from here.");
if (*inbuf == '\033')
if (*inbuf == '\033' || *inbuf == '\0')
return ECMD_OK;
mcount = atoi(inbuf);