diff options
-rw-r--r-- | crawl-ref/source/cloud.cc | 9 | ||||
-rw-r--r-- | crawl-ref/source/cloud.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/enum.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/view.cc | 4 |
4 files changed, 15 insertions, 2 deletions
diff --git a/crawl-ref/source/cloud.cc b/crawl-ref/source/cloud.cc index 43fc2ee1c6..8ecfa7b158 100644 --- a/crawl-ref/source/cloud.cc +++ b/crawl-ref/source/cloud.cc @@ -264,3 +264,12 @@ void place_cloud(int cl_type, int ctarget_x, } } } // end place_cloud(); + +bool is_opaque_cloud(unsigned char cloud_idx) +{ + if ( cloud_idx == EMPTY_CLOUD ) + return false; + const int ctype = env.cloud[cloud_idx].type; + return ( ctype == CLOUD_BLACK_SMOKE || + (ctype >= CLOUD_GREY_SMOKE && ctype <= CLOUD_STEAM) ); +} diff --git a/crawl-ref/source/cloud.h b/crawl-ref/source/cloud.h index 65cb2db888..94b25834c6 100644 --- a/crawl-ref/source/cloud.h +++ b/crawl-ref/source/cloud.h @@ -24,4 +24,6 @@ void place_cloud(int cl_type, int ctarget_x, int ctarget_y, int cl_range, void manage_clouds(void); +bool is_opaque_cloud(unsigned char cloud_idx); + #endif diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index 65112200c4..47863dcb21 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -533,7 +533,7 @@ enum cloud_type CLOUD_MIASMA, CLOUD_BLACK_SMOKE, CLOUD_MIST, - CLOUD_RANDOM = 98, + CLOUD_RANDOM = 98, CLOUD_DEBUGGING = 99 // 99: used once as 'nonexistent cloud' {dlb} }; diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index 5f855bb9da..5a8ec55e06 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -35,6 +35,7 @@ #include "externs.h" #include "command.h" +#include "cloud.h" #include "clua.h" #include "debug.h" #include "delay.h" @@ -1667,7 +1668,8 @@ void losight(FixedArray < unsigned int, 19, 19 > &sh, continue; // if this cell is opaque... - if ( grid_is_opaque(gr[realx][realy])) + if ( grid_is_opaque(gr[realx][realy]) || + is_opaque_cloud(env.cgrid[realx][realy]) ) { // then block the appropriate rays for ( unsigned int i = 0; i < num_words; ++i ) |