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/player.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/player.cc')
-rw-r--r-- | crawl-ref/source/player.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 40c39454aa..254c1c17ac 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -120,10 +120,10 @@ bool move_player_to_grid( const coord_def& p, bool stepped, bool allow_shift, ASSERT( you.can_pass_through_feat( new_grid ) ); // Better not be an unsubmerged monster either. - ASSERT(swapping && mgrd(p) != NON_MONSTER - || !swapping && (mgrd(p) == NON_MONSTER - || menv[ mgrd(p) ].submerged() - || feawn_passthrough(&menv[mgrd(p)]))); + ASSERT(swapping && monster_at(p) + || !swapping && (!monster_at(p) + || monster_at(p)->submerged() + || feawn_passthrough(monster_at(p)))); // Don't prompt if force is true. if (!force) |