specifying -D (or -X) to enter explore mode while restarting from a save
file was lost in the restore process
fix crash when using lookat on an known invisible monster with monster syms set
+prevent getting stuck in infinite loop when using wizard mode #levelchange
+ command to reduce level while having level-drain resistance
Platform- and/or Interface-Specific Fixes
-/* SCCS Id: @(#)cmd.c 3.4 2002/01/17 */
+/* SCCS Id: @(#)cmd.c 3.4 2002/06/23 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
return 0;
}
+/* #levelchange command */
STATIC_PTR int
wiz_level_change()
{
}
if (newlevel < 1) newlevel = 1;
while (u.ulevel > newlevel)
- losexp((const char *)0);
+ losexp("#levelchange");
} else {
if (u.ulevel >= MAXULEV) {
You("are already as experienced as you can get.");
-/* SCCS Id: @(#)exper.c 3.4 2002/01/15 */
+/* SCCS Id: @(#)exper.c 3.4 2002/06/23 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
{
register int num;
- if (resists_drli(&youmonst)) return;
+#ifdef WIZARD
+ /* override life-drain resistance when handling an explicit
+ wizard mode request to reduce level; never fatal though */
+ if (drainer && !strcmp(drainer, "#levelchange"))
+ drainer = 0;
+ else
+#endif
+ if (resists_drli(&youmonst)) return;
if (u.ulevel > 1) {
pline("%s level %d.", Goodbye(), u.ulevel--);
if (u.ulevel < urole.xlev)
num = rn1((int)ACURR(A_WIS)/2 + urole.enadv.lornd + urace.enadv.lornd,
- urole.enadv.lofix + urace.enadv.lofix);
+ urole.enadv.lofix + urace.enadv.lofix);
else
num = rn1((int)ACURR(A_WIS)/2 + urole.enadv.hirnd + urace.enadv.hirnd,
- urole.enadv.hifix + urace.enadv.hifix);
+ urole.enadv.hifix + urace.enadv.hifix);
num = enermod(num); /* M. Stephenson */
u.uenmax -= num;
if (u.uenmax < 0) u.uenmax = 0;