#dip fix (trunk only)
A post-3.4.3 dipping change (to make the dipping prompt mention the item that you've chosen to dip) formats a phrase for its eventual getobj() call in advance, but then was modifying it inappropriately if you were on a fountain or pool location. If you declined to dip into the fountain or pool, the prompt for carried potion to dip into was garbled: "What do you want to Dip <the object> into the fountain??". instead of "What do you want to dip <the object> into?". Fix to use a separate buffer in the case of a fountain or pool prompt so that the "dip <the object> into" phrase will be intact when calling getobj().
This commit is contained in:
19
src/potion.c
19
src/potion.c
@@ -1744,11 +1744,10 @@ dodip()
|
|||||||
{
|
{
|
||||||
register struct obj *potion, *obj;
|
register struct obj *potion, *obj;
|
||||||
struct obj *singlepotion;
|
struct obj *singlepotion;
|
||||||
const char *tmp;
|
|
||||||
uchar here;
|
uchar here;
|
||||||
char allowall[2];
|
char allowall[2];
|
||||||
short mixture;
|
short mixture;
|
||||||
char qbuf[QBUFSZ];
|
char qbuf[QBUFSZ], qtoo[QBUFSZ];
|
||||||
|
|
||||||
allowall[0] = ALL_CLASSES; allowall[1] = '\0';
|
allowall[0] = ALL_CLASSES; allowall[1] = '\0';
|
||||||
if(!(obj = getobj(allowall, "dip")))
|
if(!(obj = getobj(allowall, "dip")))
|
||||||
@@ -1759,17 +1758,20 @@ dodip()
|
|||||||
here = levl[u.ux][u.uy].typ;
|
here = levl[u.ux][u.uy].typ;
|
||||||
/* Is there a fountain to dip into here? */
|
/* Is there a fountain to dip into here? */
|
||||||
if (IS_FOUNTAIN(here)) {
|
if (IS_FOUNTAIN(here)) {
|
||||||
Strcat(qbuf, " the fountain?");
|
/* "Dip <the object> into the fountain?" */
|
||||||
if (yn(upstart(qbuf)) == 'y') {
|
Sprintf(qtoo, "%s the fountain?", qbuf);
|
||||||
|
if (yn(upstart(qtoo)) == 'y') {
|
||||||
dipfountain(obj);
|
dipfountain(obj);
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
} else if (is_pool(u.ux,u.uy)) {
|
} else if (is_pool(u.ux,u.uy)) {
|
||||||
tmp = waterbody_name(u.ux,u.uy);
|
const char *pooltype = waterbody_name(u.ux,u.uy);
|
||||||
Sprintf(eos(qbuf), " the %s?", tmp);
|
|
||||||
if (yn(upstart(qbuf)) == 'y') {
|
/* "Dip <the object> into the {pool, moat, &c}?" */
|
||||||
|
Sprintf(qtoo, "%s the %s?", qbuf, pooltype);
|
||||||
|
if (yn(upstart(qtoo)) == 'y') {
|
||||||
if (Levitation) {
|
if (Levitation) {
|
||||||
floating_above(tmp);
|
floating_above(pooltype);
|
||||||
#ifdef STEED
|
#ifdef STEED
|
||||||
} else if (u.usteed && !is_swimmer(u.usteed->data) &&
|
} else if (u.usteed && !is_swimmer(u.usteed->data) &&
|
||||||
P_SKILL(P_RIDING) < P_BASIC) {
|
P_SKILL(P_RIDING) < P_BASIC) {
|
||||||
@@ -1784,6 +1786,7 @@ dodip()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* "What do you want to dip <the object> into?" */
|
||||||
potion = getobj(beverages, qbuf); /* "dip into" */
|
potion = getobj(beverages, qbuf); /* "dip into" */
|
||||||
if (!potion) return 0;
|
if (!potion) return 0;
|
||||||
if (potion == obj && potion->quan == 1L) {
|
if (potion == obj && potion->quan == 1L) {
|
||||||
|
|||||||
Reference in New Issue
Block a user