]> granicus.if.org Git - nethack/commitdiff
U58 - Targetting problem with infravision/ESP
authorcohrs <cohrs>
Mon, 3 Mar 2003 05:56:58 +0000 (05:56 +0000)
committercohrs <cohrs>
Mon, 3 Mar 2003 05:56:58 +0000 (05:56 +0000)
A skilled/expert caster of fireball/cone of cold was not able to target
a location with a monster seen only by infravision/ESP.  Since you can
focus on the monster there, targetting shouldn't fail in this case.
Attempting to lock onto a monster inside stone still won't work.

doc/fixes35.0
src/spell.c

index d73c4ec5b31f4d3fa3689db68c7689aa426431ba..1533622440d81815ec6296874827b18248acef16 100644 (file)
@@ -7,6 +7,8 @@ typos fixed in data.base
 bad capitalization of msg when charging for something that catches light
 missing opthelp for use_inverse
 Never say "It moves only reluctantly"
+expert fireball/cone of cold could not target a monster seen only with
+       infravision or ESP
 
 
 Platform- and/or Interface-Specific Fixes
index 4659cfa1307d806226cd7f572b053e0b50532788..facd95a63650af82b9f45cb8368ea0326c47d790 100644 (file)
@@ -968,6 +968,7 @@ STATIC_OVL int
 throwspell()
 {
        coord cc;
+       struct monst *mtmp;
 
        if (u.uinwater) {
            pline("You're joking! In this weather?"); return 0;
@@ -990,14 +991,16 @@ throwspell()
            u.dx = 0;
            u.dy = 0;
            return 1;
-       } else if (!cansee(cc.x, cc.y) || IS_STWALL(levl[cc.x][cc.y].typ)) {
+       } else if ((!cansee(cc.x, cc.y) &&
+                   (!(mtmp = m_at(cc.x, cc.y)) || !canspotmon(mtmp))) ||
+                  IS_STWALL(levl[cc.x][cc.y].typ)) {
            Your("mind fails to lock onto that location!");
            return 0;
-       } else {
-           u.dx=cc.x;
-           u.dy=cc.y;
-           return 1;
        }
+
+       u.dx = cc.x;
+       u.dy = cc.y;
+       return 1;
 }
 
 void