From 6426e61860f984abc548a4369b7987d23a72d60d Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 6 Sep 2019 22:09:03 +0300 Subject: [PATCH 1/3] Prevent a possible impossible when guard relocated a monster --- doc/fixes36.3 | 1 + src/vault.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/fixes36.3 b/doc/fixes36.3 index f51350117..d0f1fcb89 100644 --- a/doc/fixes36.3 +++ b/doc/fixes36.3 @@ -136,6 +136,7 @@ have 'O' update persistent inventory window if 'implicit_uncursed', when spellcasting monster aimed at wrong spot due to not being able to see invisible hero, feedback could be erroneous if hero could see self [messages used 'if (Invisible)' test where 'if (Invis)' was meant] +prevent impossible when guard tries to relocate a monster on a full level Fixes to Post-3.6.2 Problems that Were Exposed Via git Repository diff --git a/src/vault.c b/src/vault.c index 7340ba2a4..6ff80fa76 100644 --- a/src/vault.c +++ b/src/vault.c @@ -79,7 +79,8 @@ boolean forceshow; } else if (!in_fcorridor(grd, u.ux, u.uy)) { if (mtmp->mtame) yelp(mtmp); - (void) rloc(mtmp, FALSE); + if (!rloc(mtmp, TRUE)) + m_into_limbo(mtmp); } } lev = &levl[fcx][fcy]; From c53a72162c30da48dd631706ae63fd06bccc580e Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 6 Sep 2019 14:27:40 -0700 Subject: [PATCH 2/3] fix github issue 210 - dead code in sp_lev.c Fixes #210 Subject was 'Bad loop condition in sp_lev.c'. Some object creation code had handling for something that couldn't happen due to the logic leading up to it. I couldn't figure out any way to make it useful so just remove the dead code. --- src/sp_lev.c | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/src/sp_lev.c b/src/sp_lev.c index dbab1dfdc..2c5628fc3 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 sp_lev.c $NHDT-Date: 1553787633 2019/03/28 15:40:33 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.111 $ */ +/* NetHack 3.6 sp_lev.c $NHDT-Date: 1567805254 2019/09/06 21:27:34 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.117 $ */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ @@ -1937,7 +1937,7 @@ struct mkroom *croom; otmp->owt = weight(otmp); } - /* contents */ + /* contents (of a container or monster's inventory) */ if (o->containment & SP_OBJ_CONTENT) { if (!container_idx) { if (!invent_carrying_monster) { @@ -1949,27 +1949,10 @@ struct mkroom *croom; outside the des-file. Maybe another data file that determines what inventories monsters get by default? */ + ; /* ['otmp' remains on floor] */ } else { - int ci; - struct obj *objcheck = otmp; - int inuse = -1; - - for (ci = 0; ci < container_idx; ci++) - if (container_obj[ci] == objcheck) - inuse = ci; remove_object(otmp); - if (mpickobj(invent_carrying_monster, otmp)) { - if (inuse > -1) { - impossible( - "container given to monster was merged or deallocated."); - for (ci = inuse; ci < container_idx - 1; ci++) - container_obj[ci] = container_obj[ci + 1]; - container_obj[container_idx] = NULL; - container_idx--; - } - /* we lost track of it. */ - return; - } + (void) mpickobj(invent_carrying_monster, otmp); } } else { struct obj *cobj = container_obj[container_idx - 1]; From 1a97dce7278275c14c1e98c157e9024b1ac1a0ea Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 6 Sep 2019 14:39:25 -0700 Subject: [PATCH 3/3] fix github issue 218 = hallu vs passive gaze Fixes #218 Hallucinating hero has 75% to be unaffected by a gaze counterattack that paralyzes. Check for that before checking free action (100% chance to be unaffected). The only change is that player might get different feedback when both forms of protection against the gaze. --- doc/fixes36.3 | 4 +++- src/uhitm.c | 11 +++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/doc/fixes36.3 b/doc/fixes36.3 index d0f1fcb89..734272ffa 100644 --- a/doc/fixes36.3 +++ b/doc/fixes36.3 @@ -1,4 +1,4 @@ -$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.108 $ $NHDT-Date: 1567418344 2019/09/02 09:59:04 $ +$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.110 $ $NHDT-Date: 1567805962 2019/09/06 21:39:22 $ This fixes36.3 file is here to capture information about updates in the 3.6.x lineage following the release of 3.6.2 in May 2019. Please note, however, @@ -137,6 +137,8 @@ when spellcasting monster aimed at wrong spot due to not being able to see invisible hero, feedback could be erroneous if hero could see self [messages used 'if (Invisible)' test where 'if (Invis)' was meant] prevent impossible when guard tries to relocate a monster on a full level +hallucination provides partial protection from passive gaze counterattack + against hero's attack; check for that before checking for free action Fixes to Post-3.6.2 Problems that Were Exposed Via git Repository diff --git a/src/uhitm.c b/src/uhitm.c index 83bb49ca2..371b3fd99 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 uhitm.c $NHDT-Date: 1562876956 2019/07/11 20:29:16 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.211 $ */ +/* NetHack 3.6 uhitm.c $NHDT-Date: 1567805813 2019/09/06 21:36:53 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.212 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2854,13 +2854,16 @@ boolean wep_was_destroyed; if (ureflects("%s gaze is reflected by your %s.", s_suffix(Monnam(mon)))) { ; - } else if (Free_action) { - You("momentarily stiffen under %s gaze!", - s_suffix(mon_nam(mon))); } else if (Hallucination && rn2(4)) { + /* [it's the hero who should be getting paralyzed + and isn't; this message describes the monster's + reaction rather than the hero's escape] */ pline("%s looks %s%s.", Monnam(mon), !rn2(2) ? "" : "rather ", !rn2(2) ? "numb" : "stupified"); + } else if (Free_action) { + You("momentarily stiffen under %s gaze!", + s_suffix(mon_nam(mon))); } else { You("are frozen by %s gaze!", s_suffix(mon_nam(mon))); nomul((ACURR(A_WIS) > 12 || rn2(4)) ? -tmp : -127);