summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorJude Brown <bookofjude@users.sourceforge.net>2009-11-14 17:07:03 +1000
committerJude Brown <bookofjude@users.sourceforge.net>2009-11-14 19:31:11 +1000
commita988600392e3046073b4dd8093f7772c19c128d1 (patch)
treee1d09c16b3887ccd5edf33b4bf07469c1bbd0442 /crawl-ref
parentf37bed5062ace2ef3f1b7a87409aa64f3f02f65e (diff)
downloadcrawl-ref-a988600392e3046073b4dd8093f7772c19c128d1.tar.gz
crawl-ref-a988600392e3046073b4dd8093f7772c19c128d1.zip
Bounds check for non-confused player movement.
Currently, the only bounds check for player movement is while the player was confused. This doesn't case issues at the minute, as the only in-use out of bounds glyphs are impassable, so it hasn't been encoutered as a bug yet.
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/acr.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index bb8bd1ba16..4ebfd170cc 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -3918,6 +3918,11 @@ static void _move_player(coord_def move)
}
const coord_def& targ = you.pos() + move;
+
+ // You can't walk out of bounds!
+ if (!in_bounds(targ))
+ return;
+
const dungeon_feature_type targ_grid = grd(targ);
monsters* targ_monst = monster_at(targ);