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/monster.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/monster.cc')
-rw-r--r-- | crawl-ref/source/monster.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc index 300c44a4ae..4fb0f265ba 100644 --- a/crawl-ref/source/monster.cc +++ b/crawl-ref/source/monster.cc @@ -3898,7 +3898,7 @@ static bool _prepare_del_ench(monsters* mon, const mon_enchant &me) int midx = mon->mindex(); - if (mgrd(mon->pos()) == NON_MONSTER) + if (!monster_at(mon->pos())) mgrd(mon->pos()) = midx; if (mon->pos() != you.pos() && midx == mgrd(mon->pos())) @@ -3935,7 +3935,7 @@ static bool _prepare_del_ench(monsters* mon, const mon_enchant &me) int okay_squares = 0; for (adjacent_iterator ai; ai; ++ai) - if (mgrd(*ai) == NON_MONSTER && *ai != you.pos() + if (!actor_at(*ai) && monster_can_submerge(mon, grd(*ai)) && one_chance_in(++okay_squares)) { @@ -3957,7 +3957,7 @@ static bool _prepare_del_ench(monsters* mon, const mon_enchant &me) // Try to move to an adjacent square where it would be happy. for (adjacent_iterator ai; ai; ++ai) { - if (mgrd(*ai) == NON_MONSTER + if (!monster_at(*ai) && monster_habitable_grid(mon, grd(*ai)) && !find_trap(*ai)) { |