From 0d61daab317636fdbfa7b6100f41aa3d67bfe514 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 15 Aug 2014 14:39:21 -0400 Subject: remove clouds if solid features are shifted onto them (8549) --- crawl-ref/source/cloud.cc | 2 ++ crawl-ref/source/terrain.cc | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/crawl-ref/source/cloud.cc b/crawl-ref/source/cloud.cc index ceaa07c0c0..f4986f7e7c 100644 --- a/crawl-ref/source/cloud.cc +++ b/crawl-ref/source/cloud.cc @@ -478,6 +478,8 @@ void move_cloud_to(coord_def src, coord_def dst) // that clouds get moved along with the rest of the map. void move_cloud(int cloud, const coord_def& newpos) { + ASSERT(!cell_is_solid(newpos)); + if (cloud != EMPTY_CLOUD) { const coord_def oldpos = env.cloud[cloud].pos; diff --git a/crawl-ref/source/terrain.cc b/crawl-ref/source/terrain.cc index a3e6fbf0da..014a368a8b 100644 --- a/crawl-ref/source/terrain.cc +++ b/crawl-ref/source/terrain.cc @@ -863,7 +863,14 @@ void dgn_move_entities_at(coord_def src, coord_def dst, if (move_items) move_item_stack_to_grid(src, dst); - move_cloud_to(src, dst); + if (cell_is_solid(dst)) + { + int cl = env.cgrid(dst); + if (cl != EMPTY_CLOUD) + delete_cloud(cl); + } + else + move_cloud_to(src, dst); // Move terrain colours and properties. env.pgrid(dst) = env.pgrid(src); -- cgit v1.2.3-54-g00ecf