From 62cba73fa0b680b992c6c11ba59268617abd35ae Mon Sep 17 00:00:00 2001 From: zelgadis Date: Mon, 15 Oct 2007 06:36:07 +0000 Subject: Some fixes for mermaid beholding: * A mermaid stops beholding if it polymorphs into something else. * If new walls are created, then Crawl stops the beholdment of any mermaid that gets hidden by the new walls. * Do paranoid sanity checking on beholders before each command with check_beholders() and try to restore sanity if any bugs are found (and give a diagnostics message if DEBUG is set). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2465 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/spells3.cc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'crawl-ref/source/spells3.cc') diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc index f35ae60e35..9bbb8789e5 100644 --- a/crawl-ref/source/spells3.cc +++ b/crawl-ref/source/spells3.cc @@ -766,7 +766,29 @@ bool entomb(int powc) } if (number_built > 0) + { mpr("Walls emerge from the floor!"); + + for (int i = you.beheld_by.size() - 1; i >= 0; i--) + { + const monsters* mon = &menv[you.beheld_by[i]]; + const coord_def pos = mon->pos(); + int walls = num_feats_between(you.x_pos, you.y_pos, + pos.x, pos.y, DNGN_UNSEEN, + DNGN_MAXWALL); + + if (walls > 0) + { + update_beholders(mon, true); + if (you.beheld_by.empty()) + { + you.duration[DUR_BEHELD] = 0; + break; + } + continue; + } + } + } else canned_msg(MSG_NOTHING_HAPPENS); -- cgit v1.2.3-54-g00ecf