diff options
author | ennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-19 16:02:35 +0000 |
---|---|---|
committer | ennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-19 16:02:35 +0000 |
commit | 7cfae909af95fc2a633a0aa25e5d644677fe4a52 (patch) | |
tree | 5a513a40d8acc40f90b615e07e964ec2f2d0c994 /crawl-ref/source/player.cc | |
parent | e58388c7925c5572450709785f83f8901fbeecef (diff) | |
download | crawl-ref-7cfae909af95fc2a633a0aa25e5d644677fe4a52.tar.gz crawl-ref-7cfae909af95fc2a633a0aa25e5d644677fe4a52.zip |
Applying r6609 to 0.4.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@6610 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r-- | crawl-ref/source/player.cc | 8 |
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) |