summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells4.cc
diff options
context:
space:
mode:
authorStefan O'Rear <stefanor@cox.net>2009-12-30 00:57:03 -0800
committerStefan O'Rear <stefanor@cox.net>2009-12-30 00:57:03 -0800
commit4db1d75dca2405e186a3e9869a2aa9e058cbf71f (patch)
tree87799a99c1980b14f32668f40817d581f64f203b /crawl-ref/source/spells4.cc
parent8a504d20b9992fea2daac06faa6ca5559ca63ae0 (diff)
downloadcrawl-ref-4db1d75dca2405e186a3e9869a2aa9e058cbf71f.tar.gz
crawl-ref-4db1d75dca2405e186a3e9869a2aa9e058cbf71f.zip
Allow tiles to destroy only some items.
Diffstat (limited to 'crawl-ref/source/spells4.cc')
-rw-r--r--crawl-ref/source/spells4.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc
index 7da3ee46af..9f3f03d736 100644
--- a/crawl-ref/source/spells4.cc
+++ b/crawl-ref/source/spells4.cc
@@ -1714,13 +1714,6 @@ bool cast_portal_projectile(int pow)
bool cast_apportation(int pow, const coord_def& where)
{
- // Protect the player from destroying the item.
- if (feat_destroys_items(grd(you.pos())))
- {
- mpr( "That would be silly while over this terrain!" );
- return (false);
- }
-
if (you.trans_wall_blocking(where))
{
mpr("A translucent wall is in the way.");
@@ -1750,6 +1743,13 @@ bool cast_apportation(int pow, const coord_def& where)
item_def& item = mitm[item_idx];
+ // Protect the player from destroying the item.
+ if (feat_destroys_item(grd(you.pos()), item))
+ {
+ mpr( "That would be silly while over this terrain!" );
+ return (false);
+ }
+
// Mass of one unit.
const int unit_mass = item_mass(item);
const int max_mass = pow * 30 + random2(pow * 20);