diff options
author | David Lawrence Ramsey <dolorous@users.sourceforge.net> | 2009-11-05 12:57:13 -0600 |
---|---|---|
committer | David Lawrence Ramsey <dolorous@users.sourceforge.net> | 2009-11-05 12:57:13 -0600 |
commit | 51ded013829b4cd8f73fa7f6313e73d2f7550aa5 (patch) | |
tree | 58a2f3973efdd6fb016f3ab7a3a71809d0d888d0 /crawl-ref/source/tilepick.cc | |
parent | 418a2664a3de915971c847d9fb16e93bc263661e (diff) | |
download | crawl-ref-51ded013829b4cd8f73fa7f6313e73d2f7550aa5.tar.gz crawl-ref-51ded013829b4cd8f73fa7f6313e73d2f7550aa5.zip |
Make many checks for monster (non)existence on squares use monster_at().
Not all are changed yet, as there are several index checks still needed
for debugging purposes.
Also, make many checks for player/monster (non)existence use actor_at().
Diffstat (limited to 'crawl-ref/source/tilepick.cc')
-rw-r--r-- | crawl-ref/source/tilepick.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/crawl-ref/source/tilepick.cc b/crawl-ref/source/tilepick.cc index 579d704cf1..47caa84e56 100644 --- a/crawl-ref/source/tilepick.cc +++ b/crawl-ref/source/tilepick.cc @@ -2406,9 +2406,9 @@ int tileidx_feature(dungeon_feature_type feat, int gx, int gy) else if (player_in_branch(BRANCH_SHOALS)) t = TILE_SHOALS_SHALLOW_WATER; - if (mgrd[gx][gy] != NON_MONSTER) + monsters *mon = monster_at(coord_def(gx, gy)); + if (mon) { - monsters *mon = &menv[mgrd[gx][gy]]; // Add disturbance to tile. if (mon->submerged()) t += tile_dngn_count(t); @@ -4764,12 +4764,12 @@ void tile_finish_dngn(unsigned int *tileb, int cx, int cy) bool print_blood = true; if (inside_halo(gc)) { - if (see_cell(gc) && mgrd(gc) != NON_MONSTER) + monsters *mon = monster_at(gc); + if (see_cell(gc) && mon) { - monsters* m = &menv[mgrd(gc)]; - if (!mons_class_flag(m->type, M_NO_EXP_GAIN) - && (!mons_is_mimic(m->type) - || testbits(m->flags, MF_KNOWN_MIMIC))) + if (!mons_class_flag(mon->type, M_NO_EXP_GAIN) + && (!mons_is_mimic(mon->type) + || testbits(mon->flags, MF_KNOWN_MIMIC))) { tileb[count+1] |= TILE_FLAG_HALO; print_blood = false; |