From 5b697e0c33dbab41e41c63df1ef2b366fbf0a8d9 Mon Sep 17 00:00:00 2001 From: Stefan O'Rear Date: Wed, 30 Dec 2009 01:48:16 -0800 Subject: Shoals tide washes over items, does not push them away --- crawl-ref/source/dgn-shoals.cc | 34 +++++----------------------------- 1 file changed, 5 insertions(+), 29 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/dgn-shoals.cc b/crawl-ref/source/dgn-shoals.cc index 3547932a43..028a8984bb 100644 --- a/crawl-ref/source/dgn-shoals.cc +++ b/crawl-ref/source/dgn-shoals.cc @@ -866,8 +866,7 @@ static void _shoals_run_tide(int &tide, int &acc) acc = in_decel_margin? acc / 2 : acc * 2; } -static coord_def _shoals_escape_place_from(coord_def bad_place, - actor *act, item_def *it) +static coord_def _shoals_escape_place_from(coord_def bad_place, actor *act) { int best_height = -1000; coord_def chosen; @@ -875,8 +874,7 @@ static coord_def _shoals_escape_place_from(coord_def bad_place, { coord_def p(*ai); const dungeon_feature_type feat(grd(p)); - if ((!act || (feat_has_solid_floor(feat) && !actor_at(p))) - && (!it || !feat_destroys_item(feat, *it))) + if (feat_has_solid_floor(feat) && !actor_at(p)) { if (best_height == -1000 || shoals_heights(p) > best_height) { @@ -888,27 +886,6 @@ static coord_def _shoals_escape_place_from(coord_def bad_place, return chosen; } -static bool _shoals_tide_sweep_items_clear(coord_def c) -{ - int link = igrd(c); - if (link == NON_ITEM) - return true; - - 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; -} - static bool _shoals_tide_sweep_actors_clear(coord_def c) { actor *victim = actor_at(c); @@ -927,19 +904,18 @@ 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, victim, NULL)); + coord_def evacuation_point(_shoals_escape_place_from(c, victim)); // The tide moves on even if we cannot evacuate the tile! if (!evacuation_point.origin()) victim->move_to_pos(evacuation_point); return true; } -// The tide will attempt to push items and non-water-capable monsters to +// The tide will attempt to push non-water-capable monsters to // adjacent squares. static bool _shoals_tide_sweep_clear(coord_def c) { - return _shoals_tide_sweep_items_clear(c) - && _shoals_tide_sweep_actors_clear(c); + return _shoals_tide_sweep_actors_clear(c); } static void _shoals_apply_tide_feature_at(coord_def c, -- cgit v1.2.3-54-g00ecf