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/spl-cast.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/spl-cast.cc') diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index 6b4c21bd08..bc2b9a6bb6 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -1037,7 +1037,7 @@ static bool _spell_is_uncastable(spell_type spell) static void _try_monster_cast(spell_type spell, int powc, dist &spd, bolt &beam) { - if (mgrd(you.pos()) != NON_MONSTER) + if (monster_at(you.pos())) { mpr("Couldn't try casting monster spell because you're " "on top of a monster."); @@ -1074,7 +1074,7 @@ static void _try_monster_cast(spell_type spell, int powc, if (!spd.isTarget) mon->foe = MHITNOT; - else if (mgrd(spd.target) == NON_MONSTER) + else if (!monster_at(spd.target)) { if (spd.isMe) mon->foe = MHITYOU; -- cgit v1.2.3-54-g00ecf