From 4217eee07b0efa5b906ba66bd29a5f00a5ca1d0d Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 24 May 2024 16:23:15 -0700 Subject: [PATCH] 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. --- src/cmd.c | 4 ++-- src/wizcmds.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cmd.c b/src/cmd.c index cc9372106..c25d05d0f 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -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", diff --git a/src/wizcmds.c b/src/wizcmds.c index 8a5ff1060..cf8fc75e9 100644 --- a/src/wizcmds.c +++ b/src/wizcmds.c @@ -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);