From 037b6326b7b553ff7610b9ef70207aee35d9defa Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Mon, 20 Aug 2007 22:22:04 +0000 Subject: Throwing nets again. Added a number of functions that allow to differentiate between a net that currently traps a monster and one that doesn't, even if they are on the same square. This usually works but can fail if there's already a net lying on the target square. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2021 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/beam.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'crawl-ref/source/beam.cc') diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 6cc016e777..134ae2709c 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -2393,6 +2393,14 @@ void beam_drop_object( bolt &beam, item_def *item, int x, int y ) if (item->sub_type == MI_THROWING_NET) { copy_item_to_grid( *item, x, y, 1 ); + + if (you.x_pos == x && you.y_pos == y && !you.attribute[ATTR_CAUGHT] + || mgrd[x][y] == NON_MONSTER || !mons_is_caught(&menv[mgrd[x][y]])) + { + return; + } + + mark_net_trapping(x,y); return; } -- cgit v1.2.3-54-g00ecf