Fix reversed stinking cloud targeting logic

...and give indication when blessed scroll of fire was targeted
at illegal position.
This commit is contained in:
Pasi Kallinen
2017-08-24 09:04:50 +03:00
parent c7d13d6fa3
commit d1b4253307

View 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();