From 6f1723502bba926fdbffe9d5a5d632c285792716 Mon Sep 17 00:00:00 2001 From: ennewalker Date: Sat, 19 Jul 2008 15:56:30 +0000 Subject: [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 --- crawl-ref/source/player.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'crawl-ref/source/player.cc') 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) -- cgit v1.2.3-54-g00ecf