diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-02-13 00:47:33 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-02-13 00:47:33 +0000 |
commit | 412bcd6e779cd3883bc5c6ce29a8e79ad32c63f4 (patch) | |
tree | 45316891325a63a834b5baef43896e464ed8fedb /crawl-ref/source/spells1.cc | |
parent | 2dd4fe4a7f0b809a9f3a565f64ed6b5dcb1ab814 (diff) | |
download | crawl-ref-412bcd6e779cd3883bc5c6ce29a8e79ad32c63f4.tar.gz crawl-ref-412bcd6e779cd3883bc5c6ce29a8e79ad32c63f4.zip |
Remove a great many cases where mgrd is accessed directly in favour
of monster_at().
The hope is to eventually remove mgrd completely (in favour of scanning
through the monster list, or a different datastructure which gets updated
automatically when monsters move), and thus fix all the mgrd-out-of-sync
bugs in one fell swoop.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9056 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells1.cc')
-rw-r--r-- | crawl-ref/source/spells1.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc index a520d86637..c807b6445c 100644 --- a/crawl-ref/source/spells1.cc +++ b/crawl-ref/source/spells1.cc @@ -162,8 +162,7 @@ int blink(int pow, bool high_level_controlled_blink, bool wizard_blink) if (wizard_blink && grid_is_solid(grd(beam.target))) grd(beam.target) = DNGN_FLOOR; - if (grid_is_solid(grd(beam.target)) - || mgrd(beam.target) != NON_MONSTER) + if (grid_is_solid(grd(beam.target)) || monster_at(beam.target)) { mpr("Oops! Maybe something was there already."); random_blink(false); @@ -532,9 +531,9 @@ bool conjure_flame(int pow) const int cloud = env.cgrid(spelld.target); - if (grid_is_solid(grd(spelld.target)) || - mgrd(spelld.target) != NON_MONSTER || - (cloud != EMPTY_CLOUD && env.cloud[cloud].type != CLOUD_FIRE)) + if (grid_is_solid(grd(spelld.target)) + || monster_at(spelld.target) + || (cloud != EMPTY_CLOUD && env.cloud[cloud].type != CLOUD_FIRE)) { mpr( "There's already something there!" ); continue; |