comparison 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
comparison
equal deleted inserted replaced
77:ae7643e1194b 78:aeabbca6dc0b
166 } 166 }
167 if (which_spell >= 0 && which_spell < num_spells) nohw = TRUE; 167 if (which_spell >= 0 && which_spell < num_spells) nohw = TRUE;
168 168
169 else if (slow_invent) { 169 else if (slow_invent) {
170 register char c; 170 register char c;
171 char *spellp;
171 172
172 for (i=0; i<num_spells; i++) { 173 for (i=0; i<num_spells; i++) {
173 msg(""); 174 msg("");
174 mvwaddch(cw, 0, 0, '[');
175 waddch(cw, (char) ((int) 'a' + i));
176 waddstr(cw, "] A spell of ");
177 if (magic_spells[i].s_type == TYP_POTION) 175 if (magic_spells[i].s_type == TYP_POTION)
178 waddstr(cw, p_magic[magic_spells[i].s_which].mi_name); 176 spellp = p_magic[magic_spells[i].s_which].mi_name;
179 else if (magic_spells[i].s_type == TYP_SCROLL) 177 else if (magic_spells[i].s_type == TYP_SCROLL)
180 waddstr(cw, s_magic[magic_spells[i].s_which].mi_name); 178 spellp = s_magic[magic_spells[i].s_which].mi_name;
181 else if (magic_spells[i].s_type == TYP_STICK) 179 else if (magic_spells[i].s_type == TYP_STICK)
182 waddstr(cw, ws_magic[magic_spells[i].s_which].mi_name); 180 spellp = ws_magic[magic_spells[i].s_which].mi_name;
183 waddstr(cw, morestr); 181 mvwprintw(msgw, 0, 0, "[%c] A spell of %s", (char) ((int) 'a' + i),
184 draw(cw); 182 spellp);
183 waddstr(msgw, morestr);
184 draw(msgw);
185 do { 185 do {
186 c = readchar(); 186 c = readchar();
187 } while (c != ' ' && c != ESCAPE); 187 } while (c != ' ' && c != ESCAPE);
188 if (c == ESCAPE) 188 if (c == ESCAPE)
189 break; 189 break;
190 } 190 }
191 msg(""); 191 msg("");
192 mvwaddstr(cw, 0, 0, "Which spell are you casting? "); 192 mvwaddstr(msgw, 0, 0, "Which spell are you casting? ");
193 draw(cw); 193 draw(msgw);
194 } 194 }
195 else { 195 else {
196 /* Set up for redraw */ 196 /* Set up for redraw */
197 msg(""); 197 msg("");
198 clearok(cw, TRUE); 198 clearok(cw, TRUE);
373 } 373 }
374 if (which_prayer >= 0 && which_prayer < num_prayers) nohw = TRUE; 374 if (which_prayer >= 0 && which_prayer < num_prayers) nohw = TRUE;
375 375
376 else if (slow_invent) { 376 else if (slow_invent) {
377 register char c; 377 register char c;
378 char *prayerp;
378 379
379 for (i=0; i<num_prayers; i++) { 380 for (i=0; i<num_prayers; i++) {
380 msg(""); 381 msg("");
381 mvwaddch(cw, 0, 0, '[');
382 waddch(cw, (char) ((int) 'a' + i));
383 waddstr(cw, "] A prayer for ");
384 if (cleric_spells[i].s_type == TYP_POTION) 382 if (cleric_spells[i].s_type == TYP_POTION)
385 waddstr(cw, p_magic[cleric_spells[i].s_which].mi_name); 383 prayerp = p_magic[cleric_spells[i].s_which].mi_name;
386 else if (cleric_spells[i].s_type == TYP_SCROLL) 384 else if (cleric_spells[i].s_type == TYP_SCROLL)
387 waddstr(cw, s_magic[cleric_spells[i].s_which].mi_name); 385 prayerp = s_magic[cleric_spells[i].s_which].mi_name;
388 else if (cleric_spells[i].s_type == TYP_STICK) 386 else if (cleric_spells[i].s_type == TYP_STICK)
389 waddstr(cw, ws_magic[cleric_spells[i].s_which].mi_name); 387 prayerp = ws_magic[cleric_spells[i].s_which].mi_name;
390 waddstr(cw, morestr); 388 mvwprintw(msgw, 0, 0, "[%c] A prayer for %s",
391 draw(cw); 389 (char) ((int) 'a' + i), prayerp);
390 waddstr(msgw, morestr);
391 draw(msgw);
392 do { 392 do {
393 c = readchar(); 393 c = readchar();
394 } while (c != ' ' && c != ESCAPE); 394 } while (c != ' ' && c != ESCAPE);
395 if (c == ESCAPE) 395 if (c == ESCAPE)
396 break; 396 break;
397 } 397 }
398 msg(""); 398 msg("");
399 mvwaddstr(cw, 0, 0, "Which prayer are you offering? "); 399 mvwaddstr(msgw, 0, 0, "Which prayer are you offering? ");
400 draw(cw); 400 draw(msgw);
401 } 401 }
402 else { 402 else {
403 /* Set up for redraw */ 403 /* Set up for redraw */
404 msg(""); 404 msg("");
405 clearok(cw, TRUE); 405 clearok(cw, TRUE);