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/terrain.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crawl-ref/source/terrain.cc') diff --git a/crawl-ref/source/terrain.cc b/crawl-ref/source/terrain.cc index 8a834dac7b..e7f9458985 100644 --- a/crawl-ref/source/terrain.cc +++ b/crawl-ref/source/terrain.cc @@ -958,9 +958,9 @@ bool swap_features(const coord_def &pos1, const coord_def &pos2, mgrd(pos1) = m2; mgrd(pos2) = m1; - if (mgrd(pos1) != NON_MONSTER) + if (monster_at(pos1)) menv[mgrd(pos1)].position = pos1; - if (mgrd(pos2) != NON_MONSTER) + if (monster_at(pos2)) menv[mgrd(pos2)].position = pos2; // Swap clouds. @@ -1099,8 +1099,8 @@ bool fall_into_a_pool( const coord_def& entry, bool allow_shift, else { // back out the way we came in, if possible - if (grid_distance( you.pos(), entry ) == 1 - && mgrd(entry) == NON_MONSTER) + if (grid_distance(you.pos(), entry) == 1 + && !monster_at(entry)) { escape = true; empty = entry; -- cgit v1.2.3-54-g00ecf