summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/decks.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-01 13:00:18 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-01 13:00:18 +0000
commit3277cad8b229ada132bae8e12261e5cd7e986f21 (patch)
treef3c0d277f5e171511212ea71c55c0f4b4ce603be /crawl-ref/source/decks.cc
parent24af43ae3c81cb6ffef312226d236f40d96bfc19 (diff)
downloadcrawl-ref-3277cad8b229ada132bae8e12261e5cd7e986f21.tar.gz
crawl-ref-3277cad8b229ada132bae8e12261e5cd7e986f21.zip
Fix Swap card not applying terrain effects, and not unsubmerging monsters.
Fixes [2502780]. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8873 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/decks.cc')
-rw-r--r--crawl-ref/source/decks.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/crawl-ref/source/decks.cc b/crawl-ref/source/decks.cc
index 4e81f130c7..0a68bc629f 100644
--- a/crawl-ref/source/decks.cc
+++ b/crawl-ref/source/decks.cc
@@ -1376,17 +1376,20 @@ static void _swap_monster_card(int power, deck_rarity_type rarity)
return;
}
- bool mon_caught = mons_is_caught(&mon);
- bool you_caught = you.attribute[ATTR_HELD];
+ const bool mon_caught = mons_is_caught(&mon);
+ const bool you_caught = you.attribute[ATTR_HELD];
+
+ // If it was submerged, it surfaces first.
+ mon.del_ench(ENCH_SUBMERGED);
// Pick the monster up.
mgrd(newpos) = NON_MONSTER;
-
mon.moveto(you.pos());
// Plunk it down.
mgrd(mon.pos()) = monster_index(mon_to_swap);
+
if (you_caught)
{
check_net_will_hold_monster(&mon);
@@ -1395,8 +1398,7 @@ static void _swap_monster_card(int power, deck_rarity_type rarity)
}
// Move you to its previous location.
- // FIXME: this should also handle merfolk swimming, etc.
- you.moveto(newpos);
+ move_player_to_grid(newpos, false, true, true, false);
if (mon_caught)
{