From 51ded013829b4cd8f73fa7f6313e73d2f7550aa5 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Thu, 5 Nov 2009 12:57:13 -0600 Subject: 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(). --- crawl-ref/source/tilepick.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'crawl-ref/source/tilepick.cc') 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; -- cgit v1.2.3-54-g00ecf