summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpauldubois <pauldubois@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-16 02:27:38 +0000
committerpauldubois <pauldubois@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-16 02:27:38 +0000
commitf3e9c1a0989f0c755360ec40d0ae642eedacf268 (patch)
treec272e6ffc5704ae187fc6f4ac43ce667b2f0c539
parent69cde0d0b00e4e413e030469ebbf17dff563896c (diff)
downloadcrawl-ref-f3e9c1a0989f0c755360ec40d0ae642eedacf268.tar.gz
crawl-ref-f3e9c1a0989f0c755360ec40d0ae642eedacf268.zip
Fix door opening and closing not updating the entire door.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3668 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/acr.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index 519c787b7b..d5b40a209c 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -3496,6 +3496,12 @@ static void open_door(int move_x, int move_y, bool check_confused)
{
const coord_def& dc = *i;
grd[dc.x][dc.y] = DNGN_OPEN_DOOR;
+ // Even if some of the door is out of LOS, we want the entire
+ // door to be updated. Hitting this case requires a really big
+ // door!
+ // Should set_terrain_changed() be used, too?
+ if (is_terrain_seen(dc))
+ set_envmap_obj(dc.x, dc.y, DNGN_OPEN_DOOR);
}
you.turn_is_over = true;
}
@@ -3605,7 +3611,13 @@ static void close_door(int door_x, int door_y)
i != all_door.end(); ++i)
{
const coord_def& dc = *i;
- grd[dc.x][dc.y] = DNGN_CLOSED_DOOR;
+ grd(dc) = DNGN_CLOSED_DOOR;
+ // Even if some of the door is out of LOS once it's closed (or even
+ // if some of it is out of LOS when it's open), we want the entire
+ // door to be updated.
+ // Should set_terrain_changed() be used, too?
+ if (is_terrain_seen(dc))
+ set_envmap_obj(dc.x, dc.y, DNGN_CLOSED_DOOR);
}
you.turn_is_over = true;
}