Mercurial > hg > early-roguelike
diff arogue5/player.c @ 78:aeabbca6dc0b
arogue5: fix some more drawing to the wrong window.
The spell-choosing and prayer-choosing routines, when the one-line
inventory option is set, displayed to cw instead of msgw. This caused
permanent corruption of the message line.
author | John "Elwin" Edwards <elwin@sdf.org> |
---|---|
date | Sun, 09 Sep 2012 15:55:51 -0700 |
parents | 0ed67132cf10 |
children | 34a87d84ea31 |
line wrap: on
line diff
--- a/arogue5/player.c Sun Sep 09 08:55:11 2012 -0700 +++ b/arogue5/player.c Sun Sep 09 15:55:51 2012 -0700 @@ -168,20 +168,20 @@ else if (slow_invent) { register char c; + char *spellp; for (i=0; i<num_spells; i++) { msg(""); - mvwaddch(cw, 0, 0, '['); - waddch(cw, (char) ((int) 'a' + i)); - waddstr(cw, "] A spell of "); if (magic_spells[i].s_type == TYP_POTION) - waddstr(cw, p_magic[magic_spells[i].s_which].mi_name); + spellp = p_magic[magic_spells[i].s_which].mi_name; else if (magic_spells[i].s_type == TYP_SCROLL) - waddstr(cw, s_magic[magic_spells[i].s_which].mi_name); + spellp = s_magic[magic_spells[i].s_which].mi_name; else if (magic_spells[i].s_type == TYP_STICK) - waddstr(cw, ws_magic[magic_spells[i].s_which].mi_name); - waddstr(cw, morestr); - draw(cw); + spellp = ws_magic[magic_spells[i].s_which].mi_name; + mvwprintw(msgw, 0, 0, "[%c] A spell of %s", (char) ((int) 'a' + i), + spellp); + waddstr(msgw, morestr); + draw(msgw); do { c = readchar(); } while (c != ' ' && c != ESCAPE); @@ -189,8 +189,8 @@ break; } msg(""); - mvwaddstr(cw, 0, 0, "Which spell are you casting? "); - draw(cw); + mvwaddstr(msgw, 0, 0, "Which spell are you casting? "); + draw(msgw); } else { /* Set up for redraw */ @@ -375,20 +375,20 @@ else if (slow_invent) { register char c; + char *prayerp; for (i=0; i<num_prayers; i++) { msg(""); - mvwaddch(cw, 0, 0, '['); - waddch(cw, (char) ((int) 'a' + i)); - waddstr(cw, "] A prayer for "); if (cleric_spells[i].s_type == TYP_POTION) - waddstr(cw, p_magic[cleric_spells[i].s_which].mi_name); + prayerp = p_magic[cleric_spells[i].s_which].mi_name; else if (cleric_spells[i].s_type == TYP_SCROLL) - waddstr(cw, s_magic[cleric_spells[i].s_which].mi_name); + prayerp = s_magic[cleric_spells[i].s_which].mi_name; else if (cleric_spells[i].s_type == TYP_STICK) - waddstr(cw, ws_magic[cleric_spells[i].s_which].mi_name); - waddstr(cw, morestr); - draw(cw); + prayerp = ws_magic[cleric_spells[i].s_which].mi_name; + mvwprintw(msgw, 0, 0, "[%c] A prayer for %s", + (char) ((int) 'a' + i), prayerp); + waddstr(msgw, morestr); + draw(msgw); do { c = readchar(); } while (c != ' ' && c != ESCAPE); @@ -396,8 +396,8 @@ break; } msg(""); - mvwaddstr(cw, 0, 0, "Which prayer are you offering? "); - draw(cw); + mvwaddstr(msgw, 0, 0, "Which prayer are you offering? "); + draw(msgw); } else { /* Set up for redraw */