summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index cfa61aadd7..1611f4330e 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -106,8 +106,9 @@ static void _attribute_increase();
// stepped - normal walking moves
// allow_shift - allowed to scramble in any direction out of lava/water
// force - ignore safety checks, move must happen (traps, lava/water).
+// swapping - player is swapping with a monster at (x,y)
bool move_player_to_grid( int x, int y, bool stepped, bool allow_shift,
- bool force )
+ bool force, bool swapping )
{
ASSERT( in_bounds( x, y ) );
@@ -122,8 +123,9 @@ bool move_player_to_grid( int x, int y, bool stepped, bool allow_shift,
ASSERT( you.can_pass_through_feat( new_grid ) );
// Better not be an unsubmerged monster either.
- ASSERT(mgrd[x][y] == NON_MONSTER
- || mons_is_submerged( &menv[ mgrd[x][y] ] ));
+ ASSERT(swapping && mgrd[x][y] != NON_MONSTER ||
+ !swapping && (mgrd[x][y] == NON_MONSTER
+ || mons_is_submerged( &menv[ mgrd[x][y] ])));
const int cloud = env.cgrid[x][y];
if (cloud != EMPTY_CLOUD)