]> granicus.if.org Git - nethack/commitdiff
Fix reversed stinking cloud targeting logic
authorPasi Kallinen <paxed@alt.org>
Thu, 24 Aug 2017 06:04:50 +0000 (09:04 +0300)
committerPasi Kallinen <paxed@alt.org>
Thu, 24 Aug 2017 06:04:54 +0000 (09:04 +0300)
...and give indication when blessed scroll of fire was targeted
at illegal position.

src/read.c

index 9c0b5ccf763d8772bb3abeca4f001fffa7bee232..9732fea9668a1040fcb3dcfdae97a00e89724f55 100644 (file)
@@ -930,7 +930,7 @@ is_valid_stinking_cloud_pos(x, y, showmsg)
 int x, y;
 boolean showmsg;
 {
-    if (get_valid_stinking_cloud_pos(x,y)) {
+    if (!get_valid_stinking_cloud_pos(x,y)) {
         if (showmsg)
             You("smell rotten eggs.");
         return FALSE;
@@ -1594,12 +1594,13 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
                 pline("Where do you want to center the explosion?");
                 getpos_sethilite(display_stinking_cloud_positions, get_valid_stinking_cloud_pos);
                 (void) getpos(&cc, TRUE, "the desired position");
-                if (is_valid_stinking_cloud_pos(cc.x, cc.y, FALSE)) {
+                if (!is_valid_stinking_cloud_pos(cc.x, cc.y, FALSE)) {
                     /* try to reach too far, get burned */
                     cc.x = u.ux;
                     cc.y = u.uy;
                 }
-            } else {
+            }
+            if (cc.x == u.ux && cc.y == u.uy) {
                 pline_The("scroll erupts in a tower of flame!");
                 iflags.last_msg = PLNMSG_TOWER_OF_FLAME; /* for explode() */
                 burn_away_slime();