From 97b2ba2e545fe9b6fd646d35d1bc5dbb2e1570b0 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 14 Sep 2018 21:07:08 +0300 Subject: [PATCH] Mimics created by #wizgenesis blocked vision incorrectly --- doc/fixes36.2 | 1 + src/makemon.c | 7 +++---- src/read.c | 8 +++++++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/doc/fixes36.2 b/doc/fixes36.2 index b8fff8bea..6887cd195 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -115,6 +115,7 @@ for hilite_status of string status fields (title, dungeon-level, alignment), the types value-goes-up and -down aren't meaningful; treat them as value-changed if from config file and don't offer as choices with 'O' jumping into or over a Sokoban pit, or over a fire trap, triggers trap twice +mimics created by #wizgenesis could block or not block vision incorrectly Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository diff --git a/src/makemon.c b/src/makemon.c index 0ba833def..0d38383dc 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -2126,16 +2126,12 @@ register struct monst *mtmp; appear = Is_rogue_level(&u.uz) ? S_hwall : S_hcdoor; else appear = Is_rogue_level(&u.uz) ? S_vwall : S_vcdoor; - if (!mtmp->minvis || See_invisible) - block_point(mx, my); /* vision */ } else if (level.flags.is_maze_lev && !In_sokoban(&u.uz) && rn2(2)) { ap_type = M_AP_OBJECT; appear = STATUE; } else if (roomno < 0 && !t_at(mx, my)) { ap_type = M_AP_OBJECT; appear = BOULDER; - if (!mtmp->minvis || See_invisible) - block_point(mx, my); /* vision */ } else if (rt == ZOO || rt == VAULT) { ap_type = M_AP_OBJECT; appear = GOLD_PIECE; @@ -2193,6 +2189,9 @@ register struct monst *mtmp; if (appear == EGG && !can_be_hatched(MCORPSENM(mtmp))) MCORPSENM(mtmp) = NON_PM; /* revert to generic egg */ } + + if (does_block(mx, my, &levl[mx][my])) + block_point(mx, my); } /* release monster from bag of tricks; return number of monsters created */ diff --git a/src/read.c b/src/read.c index c4cf716e9..8691d7f4c 100644 --- a/src/read.c +++ b/src/read.c @@ -2550,8 +2550,14 @@ struct _create_particular_data *d; put_saddle_on_mon(otmp, mtmp); } - if (d->invisible) + if (d->invisible) { + int mx = mtmp->mx, my = mtmp->my; mon_set_minvis(mtmp); + if (does_block(mx, my, &levl[mx][my])) + block_point(mx, my); + else + unblock_point(mx, my); + } if (d->sleeping) mtmp->msleeping = 1; madeany = TRUE;