summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
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
parent8a504d20b9992fea2daac06faa6ca5559ca63ae0 (diff)
downloadcrawl-ref-4db1d75dca2405e186a3e9869a2aa9e058cbf71f.tar.gz
crawl-ref-4db1d75dca2405e186a3e9869a2aa9e058cbf71f.zip
Allow tiles to destroy only some items.
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/dgn-shoals.cc26
-rw-r--r--crawl-ref/source/effects.cc51
-rw-r--r--crawl-ref/source/items.cc17
-rw-r--r--crawl-ref/source/l_feat.cc5
-rw-r--r--crawl-ref/source/mon-pathfind.cc2
-rw-r--r--crawl-ref/source/religion.cc21
-rw-r--r--crawl-ref/source/spells4.cc14
-rw-r--r--crawl-ref/source/terrain.cc86
-rw-r--r--crawl-ref/source/terrain.h5
-rw-r--r--crawl-ref/source/wiz-item.cc7
-rw-r--r--crawl-ref/source/xom.cc7
11 files changed, 113 insertions, 128 deletions
diff --git a/crawl-ref/source/dgn-shoals.cc b/crawl-ref/source/dgn-shoals.cc
index 367ca497d4..3547932a43 100644
--- a/crawl-ref/source/dgn-shoals.cc
+++ b/crawl-ref/source/dgn-shoals.cc
@@ -867,7 +867,7 @@ static void _shoals_run_tide(int &tide, int &acc)
}
static coord_def _shoals_escape_place_from(coord_def bad_place,
- bool monster_free)
+ actor *act, item_def *it)
{
int best_height = -1000;
coord_def chosen;
@@ -875,8 +875,8 @@ static coord_def _shoals_escape_place_from(coord_def bad_place,
{
coord_def p(*ai);
const dungeon_feature_type feat(grd(p));
- if (!feat_is_solid(feat) && !feat_destroys_items(feat)
- && (!monster_free || !actor_at(p)))
+ if ((!act || (feat_has_solid_floor(feat) && !actor_at(p)))
+ && (!it || !feat_destroys_item(feat, *it)))
{
if (best_height == -1000 || shoals_heights(p) > best_height)
{
@@ -894,12 +894,18 @@ static bool _shoals_tide_sweep_items_clear(coord_def c)
if (link == NON_ITEM)
return true;
- const coord_def target(_shoals_escape_place_from(c, false));
- // Don't abort tide entry because of items. If we can't sweep the
- // item clear here, let dungeon_terrain_changed teleport the item
- // to the nearest safe square.
- if (!target.origin())
- move_item_stack_to_grid(c, target);
+ for (stack_iterator si(c); si; ++si)
+ {
+ const coord_def target(_shoals_escape_place_from(c, NULL, &*si));
+ // Don't abort tide entry because of items. If we can't sweep the
+ // item clear here, let dungeon_terrain_changed teleport the item
+ // to the nearest safe square.
+ int id = si.link();
+
+ if (!target.origin())
+ move_item_to_grid(&id, target);
+ }
+
return true;
}
@@ -921,7 +927,7 @@ static bool _shoals_tide_sweep_actors_clear(coord_def c)
if (monster_habitable_grid(mvictim, DNGN_DEEP_WATER))
return true;
}
- coord_def evacuation_point(_shoals_escape_place_from(c, true));
+ coord_def evacuation_point(_shoals_escape_place_from(c, victim, NULL));
// The tide moves on even if we cannot evacuate the tile!
if (!evacuation_point.origin())
victim->move_to_pos(evacuation_point);
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index dcec8a0373..a4a765177e 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -2319,6 +2319,17 @@ int acquirement_create_item(object_class_type class_wanted,
if (thing_created != NON_ITEM && !quiet)
canned_msg(MSG_SOMETHING_APPEARS);
+ // If a god wants to give you something but the floor doesn't want it,
+ // it counts as a failed acquirement - no piety, etc cost.
+ if (feat_destroys_item(grd(pos), thing) && (agent > GOD_NO_GOD) &&
+ (agent < NUM_GODS))
+ {
+ if (agent == GOD_XOM)
+ simple_god_message(" snickers.", GOD_XOM);
+ else
+ return _failed_acquirement(quiet);
+ }
+
move_item_to_grid( &thing_created, pos );
return (thing_created);
@@ -2378,23 +2389,6 @@ bool acquirement(object_class_type class_wanted, int agent,
}
}
- if (feat_destroys_items(grd(you.pos())))
- {
- if (agent > GOD_NO_GOD && agent < NUM_GODS)
- {
- if (agent == GOD_XOM)
- simple_god_message(" snickers.", GOD_XOM);
- else
- {
- ASSERT(!"God gave gift item while player was on grid which "
- "destroys items.");
- mprf(MSGCH_ERROR, "%s gave a god gift while you were on "
- "terrain which destroys items.",
- god_name((god_type) agent).c_str());
- }
- }
- }
-
acquirement_create_item(class_wanted, agent, quiet, you.pos(), debug);
return (true);
@@ -2956,11 +2950,6 @@ static void _hell_effects()
}
}
-static bool _is_floor(const dungeon_feature_type feat)
-{
- return (!feat_is_solid(feat) && !feat_destroys_items(feat));
-}
-
// This function checks whether we can turn a wall into a floor space and
// still keep a corridor-like environment. The wall in position x is a
// a candidate for switching if it's flanked by floor grids to two sides
@@ -2982,8 +2971,8 @@ static bool _feat_is_flanked_by_walls(const coord_def &p)
return (false);
return (feat_is_wall(grd(adjs[0])) && feat_is_wall(grd(adjs[1]))
- && _is_floor(grd(adjs[2])) && _is_floor(grd(adjs[3]))
- || _is_floor(grd(adjs[0])) && _is_floor(grd(adjs[1]))
+ && feat_has_solid_floor(grd(adjs[2])) && feat_has_solid_floor(grd(adjs[3]))
+ || feat_has_solid_floor(grd(adjs[0])) && feat_has_solid_floor(grd(adjs[1]))
&& feat_is_wall(grd(adjs[2])) && feat_is_wall(grd(adjs[3])));
}
@@ -3088,7 +3077,7 @@ static bool _deadend_check_floor(const coord_def &p)
continue;
const coord_def a(p.x, p.y+2*i);
- if (!in_bounds(a) || _is_floor(grd(a)))
+ if (!in_bounds(a) || feat_has_solid_floor(grd(a)))
continue;
for (int j = -1; j <= 1; j++)
@@ -3101,7 +3090,7 @@ static bool _deadend_check_floor(const coord_def &p)
continue;
const coord_def c(p.x+j, p.y+i);
- if (_is_floor(grd(c)) && !_is_floor(grd(b)))
+ if (feat_has_solid_floor(grd(c)) && !feat_has_solid_floor(grd(b)))
return (false);
}
}
@@ -3114,7 +3103,7 @@ static bool _deadend_check_floor(const coord_def &p)
continue;
const coord_def a(p.x+2*i, p.y);
- if (!in_bounds(a) || _is_floor(grd(a)))
+ if (!in_bounds(a) || feat_has_solid_floor(grd(a)))
continue;
for (int j = -1; j <= 1; j++)
@@ -3127,7 +3116,7 @@ static bool _deadend_check_floor(const coord_def &p)
continue;
const coord_def c(p.x+i, p.y+j);
- if (_is_floor(grd(c)) && !_is_floor(grd(b)))
+ if (feat_has_solid_floor(grd(c)) && !feat_has_solid_floor(grd(b)))
return (false);
}
}
@@ -3236,7 +3225,7 @@ void change_labyrinth(bool msg)
// Use the adjacent floor grids as source and destination.
coord_def src(c.x-1,c.y);
coord_def dst(c.x+1,c.y);
- if (!_is_floor(grd(src)) || !_is_floor(grd(dst)))
+ if (!feat_has_solid_floor(grd(src)) || !feat_has_solid_floor(grd(dst)))
{
src = coord_def(c.x, c.y-1);
dst = coord_def(c.x, c.y+1);
@@ -3375,7 +3364,7 @@ void change_labyrinth(bool msg)
int floor_count = 0;
coord_def new_adj(p);
for (adjacent_iterator ai(c); ai; ++ai)
- if (_is_floor(grd(*ai)) && one_chance_in(++floor_count))
+ if (feat_has_solid_floor(grd(*ai)) && one_chance_in(++floor_count))
new_adj = *ai;
if (new_adj != p && maybe_bloodify_square(new_adj))
@@ -3423,7 +3412,7 @@ void change_labyrinth(bool msg)
if (!in_bounds(p))
continue;
- if (_is_floor(grd(p)))
+ if (feat_has_solid_floor(grd(p)))
{
// Once a valid grid is found, move all items from the
// stack onto it.
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc
index 81adf191dd..1437238afd 100644
--- a/crawl-ref/source/items.cc
+++ b/crawl-ref/source/items.cc
@@ -1733,11 +1733,8 @@ bool move_item_to_grid( int *const obj, const coord_def& p, bool silent )
item_def& item(mitm[ob]);
- if (feat_destroys_items(grd(p)))
+ if (feat_destroys_item(grd(p), mitm[ob], !silenced(p) && !silent))
{
- if (!silenced(p) && !silent)
- mprf(MSGCH_SOUND, feat_item_destruction_message(grd(p)));
-
item_was_destroyed(item, NON_MONSTER);
destroy_item(ob);
ob = NON_ITEM;
@@ -1833,11 +1830,8 @@ bool copy_item_to_grid( const item_def &item, const coord_def& p,
if (quant_drop == 0)
return (false);
- if (feat_destroys_items(grd(p)))
+ if (feat_destroys_item(grd(p), item, !silenced(p) && !silent))
{
- if (!silenced(p))
- mprf(MSGCH_SOUND, feat_item_destruction_message(grd(p)));
-
item_was_destroyed(item, NON_MONSTER);
return (true);
@@ -2001,11 +1995,8 @@ bool drop_item( int item_dropped, int quant_drop, bool try_offer )
mprf("You drop %s.",
quant_name(you.inv[item_dropped], quant_drop, DESC_NOCAP_A).c_str());
- if (feat_destroys_items(my_grid))
- {
- if (!silenced(you.pos()))
- mprf(MSGCH_SOUND, feat_item_destruction_message(my_grid));
- }
+ if (feat_destroys_item(my_grid, you.inv[item_dropped], !silenced(you.pos())))
+ ;
else if (strstr(you.inv[item_dropped].inscription.c_str(), "=s") != 0)
StashTrack.add_stash();
diff --git a/crawl-ref/source/l_feat.cc b/crawl-ref/source/l_feat.cc
index 00529c11dc..baeaac20fd 100644
--- a/crawl-ref/source/l_feat.cc
+++ b/crawl-ref/source/l_feat.cc
@@ -31,10 +31,9 @@
return (1); \
}
-FEATF(_feat_destroys_items, feat_destroys_items)
-
FEATF(_feat_is_wall, feat_is_wall)
FEATF(_feat_is_solid, feat_is_solid)
+FEATF(_feat_has_solid_floor, feat_has_solid_floor)
FEATF(_feat_is_opaque, feat_is_opaque)
FEATF(_feat_is_door, feat_is_door)
FEATF(_feat_is_closed_door, feat_is_closed_door)
@@ -60,9 +59,9 @@ FEATF(_feat_is_critical, is_critical_feature)
const struct luaL_reg feat_dlib[] =
{
-{ "destroys_items", _feat_destroys_items },
{ "is_wall", _feat_is_wall },
{ "is_solid", _feat_is_solid },
+{ "has_solid_floor", _feat_has_solid_floor },
{ "is_opaque", _feat_is_opaque },
{ "is_door", _feat_is_door },
{ "is_closed_door", _feat_is_closed_door },
diff --git a/crawl-ref/source/mon-pathfind.cc b/crawl-ref/source/mon-pathfind.cc
index 173d643020..68215b5fca 100644
--- a/crawl-ref/source/mon-pathfind.cc
+++ b/crawl-ref/source/mon-pathfind.cc
@@ -392,7 +392,7 @@ bool monster_pathfind::traversable(const coord_def p)
if (mons)
return mons_traversable(p);
- return (!feat_is_solid(grd(p)) && !feat_destroys_items(grd(p)));
+ return feat_has_solid_floor(grd(p));
}
// Checks whether a given monster can pass over a certain position, respecting
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 3a0c43fb0f..3845be27d2 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -1175,7 +1175,6 @@ static bool _need_missile_gift()
const item_def *launcher = _find_missile_launcher(best_missile_skill);
return (you.piety > 80
&& random2( you.piety ) > 70
- && !feat_destroys_items( grd(you.pos()) )
&& one_chance_in(8)
&& you.skills[ best_missile_skill ] >= 8
&& (launcher || best_missile_skill == SK_DARTS));
@@ -1263,9 +1262,6 @@ static void _show_pure_deck_chances()
static void _give_nemelex_gift()
{
- if (feat_destroys_items(grd(you.pos())))
- return;
-
// Nemelex will give at least one gift early.
if (!you.num_gifts[GOD_NEMELEX_XOBEH]
&& x_chance_in_y(you.piety + 1, piety_breakpoint(1))
@@ -1289,14 +1285,16 @@ static void _give_nemelex_gift()
#if DEBUG_GIFTS || DEBUG_CARDS
_show_pure_deck_chances();
#endif
- _update_sacrifice_weights(choice);
-
int thing_created = items( 1, OBJ_MISCELLANY, gift_type,
true, 1, MAKE_ITEM_RANDOM_RACE,
0, 0, GOD_NEMELEX_XOBEH );
+ move_item_to_grid(&thing_created, you.pos(), true);
+
if (thing_created != NON_ITEM)
{
+ _update_sacrifice_weights(choice);
+
// Piety|Common | Rare |Legendary
// --------------------------------
// 0: 95.00%, 5.00%, 0.00%
@@ -1329,8 +1327,6 @@ static void _give_nemelex_gift()
deck.colour = deck_rarity_to_color(rarity);
deck.inscription = "god gift";
- move_item_to_grid(&thing_created, you.pos());
-
simple_god_message(" grants you a gift!");
more();
canned_msg(MSG_SOMETHING_APPEARS);
@@ -2046,7 +2042,6 @@ static void _do_god_gift(bool prayed_for)
case GOD_TROG:
if (you.piety > 130
&& random2(you.piety) > 120
- && !feat_destroys_items(grd(you.pos()))
&& one_chance_in(4))
{
if (you.religion == GOD_TROG
@@ -2058,7 +2053,8 @@ static void _do_god_gift(bool prayed_for)
{
success = acquirement(OBJ_ARMOUR, you.religion);
// Okawaru charges extra for armour acquirements.
- _inc_gift_timeout(30 + random2avg(15, 2));
+ if (success)
+ _inc_gift_timeout(30 + random2avg(15, 2));
}
if (success)
@@ -2194,8 +2190,7 @@ static void _do_god_gift(bool prayed_for)
}
}
- if (gift != NUM_BOOKS
- && !feat_destroys_items(grd(you.pos())))
+ if (gift != NUM_BOOKS)
{
if (gift == OBJ_RANDOM)
{
@@ -2216,7 +2211,7 @@ static void _do_god_gift(bool prayed_for)
// reason.
mark_had_book(gift);
- move_item_to_grid( &thing_created, you.pos() );
+ move_item_to_grid( &thing_created, you.pos(), true );
if (thing_created != NON_ITEM)
{
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);
diff --git a/crawl-ref/source/terrain.cc b/crawl-ref/source/terrain.cc
index 9b2fe96deb..2e3ac60cc7 100644
--- a/crawl-ref/source/terrain.cc
+++ b/crawl-ref/source/terrain.cc
@@ -321,6 +321,12 @@ bool cell_is_solid(const coord_def &c)
return (feat_is_solid(grd(c)));
}
+bool feat_has_solid_floor(dungeon_feature_type feat)
+{
+ return (!feat_is_solid(feat) && feat != DNGN_DEEP_WATER &&
+ feat != DNGN_LAVA);
+}
+
bool feat_is_door(dungeon_feature_type feat)
{
return (feat == DNGN_CLOSED_DOOR || feat == DNGN_DETECTED_SECRET_DOOR
@@ -376,11 +382,6 @@ bool feat_is_watery(dungeon_feature_type feat)
return (feat_is_water(feat) || feat == DNGN_FOUNTAIN_BLUE);
}
-bool feat_destroys_items(dungeon_feature_type feat)
-{
- return (feat == DNGN_LAVA || feat == DNGN_DEEP_WATER);
-}
-
// Returns GOD_NO_GOD if feat is not an altar, otherwise returns the
// GOD_* type.
god_type feat_altar_god(dungeon_feature_type feat)
@@ -543,16 +544,30 @@ dungeon_feature_type grid_secret_door_appearance(const coord_def &where)
: ret);
}
-const char *feat_item_destruction_message(dungeon_feature_type feat)
+bool feat_destroys_item(dungeon_feature_type feat, const item_def &item,
+ bool noisy)
{
- return (feat == DNGN_DEEP_WATER ? "You hear a splash." :
- feat == DNGN_LAVA ? "You hear a sizzling splash."
- : "You hear a crunching noise.");
+ switch (feat)
+ {
+ case DNGN_DEEP_WATER:
+ if (noisy)
+ mprf(MSGCH_SOUND, "You hear a splash.");
+ return (true);
+
+ case DNGN_LAVA:
+ if (noisy)
+ mprf(MSGCH_SOUND, "You hear a sizzling splash.");
+ return (true);
+
+ default:
+ return (false);
+ }
}
static coord_def _dgn_find_nearest_square(
const coord_def &pos,
- bool (*acceptable)(const coord_def &),
+ void *thing,
+ bool (*acceptable)(const coord_def &, void *thing),
bool (*traversable)(const coord_def &) = NULL)
{
memset(travel_point_distance, 0, sizeof(travel_distance_grid_t));
@@ -568,7 +583,7 @@ static coord_def _dgn_find_nearest_square(
{
const coord_def &p = *i;
- if (p != pos && acceptable(p))
+ if (p != pos && acceptable(p, thing))
return (p);
travel_point_distance[p.x][p.y] = 1;
@@ -597,16 +612,17 @@ static coord_def _dgn_find_nearest_square(
return (unfound);
}
-static bool _item_safe_square(const coord_def &pos)
+static bool _item_safe_square(const coord_def &pos, void *item)
{
const dungeon_feature_type feat = grd(pos);
- return (feat_is_traversable(feat) && !feat_destroys_items(feat));
+ return (feat_is_traversable(feat) &&
+ !feat_destroys_item(feat, *static_cast<item_def *>(item)));
}
// Moves an item on the floor to the nearest adjacent floor-space.
static bool _dgn_shift_item(const coord_def &pos, item_def &item)
{
- const coord_def np = _dgn_find_nearest_square(pos, _item_safe_square);
+ const coord_def np = _dgn_find_nearest_square(pos, &item, _item_safe_square);
if (in_bounds(np) && np != pos)
{
int index = item.index();
@@ -622,7 +638,7 @@ bool is_critical_feature(dungeon_feature_type feat)
|| feat_altar_god(feat) != GOD_NO_GOD);
}
-static bool _is_feature_shift_target(const coord_def &pos)
+static bool _is_feature_shift_target(const coord_def &pos, void*)
{
return (grd(pos) == DNGN_FLOOR && !dungeon_events.has_listeners_at(pos));
}
@@ -634,7 +650,7 @@ static bool _dgn_shift_feature(const coord_def &pos)
return (false);
const coord_def dest =
- _dgn_find_nearest_square(pos, _is_feature_shift_target);
+ _dgn_find_nearest_square(pos, NULL, _is_feature_shift_target);
if (in_bounds(dest) && dest != pos)
{
@@ -654,27 +670,27 @@ static bool _dgn_shift_feature(const coord_def &pos)
static void _dgn_check_terrain_items(const coord_def &pos, bool preserve_items)
{
const dungeon_feature_type feat = grd(pos);
- if (feat_is_solid(feat) || feat_destroys_items(feat))
+
+ int item = igrd(pos);
+ bool did_destroy = false;
+ while (item != NON_ITEM)
{
- int item = igrd(pos);
- bool did_destroy = false;
- while (item != NON_ITEM)
- {
- const int curr = item;
- item = mitm[item].link;
+ const int curr = item;
+ item = mitm[item].link;
- // Game-critical item.
- if (preserve_items || mitm[curr].is_critical())
- _dgn_shift_item(pos, mitm[curr]);
- else
- {
- item_was_destroyed(mitm[curr]);
- destroy_item(curr);
- did_destroy = true;
- }
+ if (!feat_is_solid(feat) && !feat_destroys_item(feat, mitm[curr]))
+ continue;
+
+ // Game-critical item.
+ if (preserve_items || mitm[curr].is_critical())
+ _dgn_shift_item(pos, mitm[curr]);
+ else
+ {
+ feat_destroys_item(feat, mitm[curr], true);
+ item_was_destroyed(mitm[curr]);
+ destroy_item(curr);
+ did_destroy = true;
}
- if (did_destroy && player_can_hear(pos))
- mprf(MSGCH_SOUND, feat_item_destruction_message(feat));
}
}
@@ -704,7 +720,7 @@ static void _dgn_check_terrain_blood(const coord_def &pos,
else
{
if (feat_is_solid(old_feat) != feat_is_solid(new_feat)
- || feat_is_water(new_feat) || feat_destroys_items(new_feat)
+ || feat_is_water(new_feat) || new_feat == DNGN_LAVA
|| is_critical_feature(new_feat))
{
env.pgrid(pos) &= ~(FPROP_BLOODY);
diff --git a/crawl-ref/source/terrain.h b/crawl-ref/source/terrain.h
index f464d29929..73c5c5ee5e 100644
--- a/crawl-ref/source/terrain.h
+++ b/crawl-ref/source/terrain.h
@@ -24,6 +24,7 @@ bool cell_is_solid(const coord_def &c);
bool feat_is_wall(dungeon_feature_type feat);
bool feat_is_opaque(dungeon_feature_type feat);
bool feat_is_solid(dungeon_feature_type feat);
+bool feat_has_solid_floor(dungeon_feature_type feat);
bool feat_is_door(dungeon_feature_type feat);
bool feat_is_closed_door(dungeon_feature_type feat);
bool feat_is_secret_door(dungeon_feature_type feat);
@@ -63,9 +64,7 @@ void find_connected_range(coord_def d, dungeon_feature_type ft_min,
void get_door_description(int door_size, const char** adjective, const char** noun);
dungeon_feature_type grid_secret_door_appearance(const coord_def &where);
dungeon_feature_type grid_appearance(const coord_def &gc);
-bool feat_destroys_items(dungeon_feature_type feat);
-
-const char *feat_item_destruction_message( dungeon_feature_type feat );
+bool feat_destroys_item(dungeon_feature_type feat, const item_def &item, bool noisy = false);
// Terrain changed under 'pos', perform necessary effects.
void dungeon_terrain_changed(const coord_def &pos,
diff --git a/crawl-ref/source/wiz-item.cc b/crawl-ref/source/wiz-item.cc
index 1bdce290dd..56b1b9bba0 100644
--- a/crawl-ref/source/wiz-item.cc
+++ b/crawl-ref/source/wiz-item.cc
@@ -822,13 +822,6 @@ void wizard_list_items()
//---------------------------------------------------------------
static void _debug_acquirement_stats(FILE *ostat)
{
- if (feat_destroys_items(grd(you.pos())))
- {
- mpr("You must stand on a square which doesn't destroy items "
- "in order to do this.");
- return;
- }
-
int p = get_item_slot(11);
if (p == NON_ITEM)
{
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc
index 4fdb333dd4..40a19123cb 100644
--- a/crawl-ref/source/xom.cc
+++ b/crawl-ref/source/xom.cc
@@ -659,11 +659,8 @@ static void _xom_make_item(object_class_type base, int subtype, int power)
items(true, base, subtype, true, power, MAKE_ITEM_RANDOM_RACE,
0, 0, GOD_XOM);
- if (feat_destroys_items(grd(you.pos())))
+ if (feat_destroys_item(grd(you.pos()), mitm[thing_created], !silenced(you.pos())))
{
- if (!silenced(you.pos()))
- mprf(MSGCH_SOUND, feat_item_destruction_message(grd(you.pos())));
-
simple_god_message(" snickers.", GOD_XOM);
destroy_item(thing_created, true);
thing_created = NON_ITEM;
@@ -2425,7 +2422,7 @@ static void _xom_zero_miscast()
}
}
- if (!feat_destroys_items(feat) && !feat_is_solid(feat)
+ if (feat_has_solid_floor(feat)
&& inv_items.size() > 0)
{
int idx = inv_items[random2(inv_items.size())];