summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells3.cc
diff options
context:
space:
mode:
authorCharles Otto <ottochar@gmail.com>2009-10-16 15:28:00 -0400
committerCharles Otto <ottochar@gmail.com>2009-10-16 17:12:32 -0400
commit1feac7b0b1cef1cea1ab107f0cce26e3a94e84b7 (patch)
tree82c6df5370ab885099c1765abdb2f15a3bc51cca /crawl-ref/source/spells3.cc
parentd5c9626b31d13b7e3b180603f72b93910679ba30 (diff)
downloadcrawl-ref-1feac7b0b1cef1cea1ab107f0cce26e3a94e84b7.tar.gz
crawl-ref-1feac7b0b1cef1cea1ab107f0cce26e3a94e84b7.zip
Fix bug [2874791], Merfolk stat change issues
Fix some conditions causing permanent stat loss or gain for Mf with stat modifying boots. Unmerge boots when the player starts levitating or flying on a water square. Use move_player_to_grid in blink, semi-controlled blink, and teleportation. Also fix a bug where Mf could random teleport into solid walls.
Diffstat (limited to 'crawl-ref/source/spells3.cc')
-rw-r--r--crawl-ref/source/spells3.cc23
1 files changed, 11 insertions, 12 deletions
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc
index 6facccd714..b6b07dcf85 100644
--- a/crawl-ref/source/spells3.cc
+++ b/crawl-ref/source/spells3.cc
@@ -1511,25 +1511,24 @@ static bool _teleport_player(bool allow_control, bool new_abyss_area)
if (!see_grid(pos))
large_change = true;
- // Leave a purple cloud.
- place_cloud(CLOUD_PURP_SMOKE, you.pos(), 1 + random2(3), KC_YOU);
-
- you.moveto(pos);
-
// Merfolk should be able to control-tele into deep water.
- if (grd(you.pos()) != DNGN_FLOOR
- && grd(you.pos()) != DNGN_SHALLOW_WATER
+ if (grd(pos) != DNGN_FLOOR
+ && grd(pos) != DNGN_SHALLOW_WATER
&& (you.species != SP_MERFOLK
- || grd(you.pos()) != DNGN_DEEP_WATER)
- || monster_at(you.pos())
- || env.cgrid(you.pos()) != EMPTY_CLOUD)
+ || grd(pos) != DNGN_DEEP_WATER)
+ || monster_at(pos)
+ || env.cgrid(pos) != EMPTY_CLOUD)
{
is_controlled = false;
large_change = false;
}
else
{
+ // Leave a purple cloud.
+ place_cloud(CLOUD_PURP_SMOKE, you.pos(), 1 + random2(3), KC_YOU);
+
// Controlling teleport contaminates the player. - bwr
+ move_player_to_grid(pos, false, true, true);
contaminate_player(1, true);
}
}
@@ -1574,7 +1573,7 @@ static bool _teleport_player(bool allow_control, bool new_abyss_area)
while (grd(newpos) != DNGN_FLOOR
&& grd(newpos) != DNGN_SHALLOW_WATER
&& (you.species != SP_MERFOLK
- || grd(you.pos()) != DNGN_DEEP_WATER)
+ || grd(newpos) != DNGN_DEEP_WATER)
|| monster_at(newpos)
|| env.cgrid(newpos) != EMPTY_CLOUD
|| need_distance_check && (newpos - centre).abs() < 34*34);
@@ -1592,7 +1591,7 @@ static bool _teleport_player(bool allow_control, bool new_abyss_area)
// Leave a purple cloud.
place_cloud(CLOUD_PURP_SMOKE, you.pos(), 1 + random2(3), KC_YOU);
- you.moveto(newpos);
+ move_player_to_grid(newpos, false, true, true);
}
if (large_change)