diff options
author | ennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-19 15:56:30 +0000 |
---|---|---|
committer | ennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-19 15:56:30 +0000 |
commit | 6f1723502bba926fdbffe9d5a5d632c285792716 (patch) | |
tree | 8ff903f4de28ee91de0cb692e67789cd24a44a82 /crawl-ref/source/player.cc | |
parent | bd188fd76ce16ab6ba0c3be8d8e29976f1ee4d3d (diff) | |
download | crawl-ref-6f1723502bba926fdbffe9d5a5d632c285792716.tar.gz crawl-ref-6f1723502bba926fdbffe9d5a5d632c285792716.zip |
[2021920] Fixing issue where swapping into a fire elemental and cancelling due to the cloud still moved the fire elemental but not the player.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6609 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 e4e7b89ae7..caf6e8b502 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) |