Skip to content

Commit

Permalink
Allow resting inside of walls in wizmode.
Browse files Browse the repository at this point in the history
The change to abort a run command early if the target square is
uninhabitable (0.20-a0-387-gf587305) also affected resting, but that
broke the woken_rest test and probably others. Instead, check for
running as opposed to resting.

Also, don't abort the run command, but simply avoid the slime wall
message, if the target square can't be entered: this change restores the
"Why would you want to do that?" message when attempting to run into
water, lava, etc. when slime walls are not nearby.
  • Loading branch information
neilmoore committed Dec 30, 2016
1 parent 5631477 commit d1c1da2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions crawl-ref/source/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1049,11 +1049,10 @@ static void _start_running(int dir, int mode)
if (!i_feel_safe(true))
return;

coord_def next_pos = you.pos() + Compass[dir];
if (!you.is_habitable_feat(grd(next_pos))) // only relevant for run
return; // don't warn about running through walls, etc
const coord_def next_pos = you.pos() + Compass[dir];

if (!have_passive(passive_t::slime_wall_immune)
&& (dir == RDIR_REST || you.is_habitable_feat(grd(next_pos)))
&& count_adjacent_slime_walls(next_pos))
{
if (dir == RDIR_REST)
Expand Down

0 comments on commit d1c1da2

Please sign in to comment.