From: Pasi Kallinen Date: Thu, 24 Aug 2017 06:04:50 +0000 (+0300) Subject: Fix reversed stinking cloud targeting logic X-Git-Tag: NetHack-3.6.1_RC01~412^2~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d1b42533072d206f0ff7cbe68143b4fb438c0661;p=nethack Fix reversed stinking cloud targeting logic ...and give indication when blessed scroll of fire was targeted at illegal position. --- diff --git a/src/read.c b/src/read.c index 9c0b5ccf7..9732fea96 100644 --- a/src/read.c +++ b/src/read.c @@ -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();