Merge branch 'win-wip3.7' into win-wip3.7-bart
This commit is contained in:
31
src/botl.c
31
src/botl.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 botl.c $NHDT-Date: 1544917592 2018/12/15 23:46:32 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.131 $ */
|
||||
/* NetHack 3.6 botl.c $NHDT-Date: 1545705812 2018/12/25 02:43:32 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.132 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Michael Allison, 2006. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -37,6 +37,14 @@ get_strength_str()
|
||||
return buf;
|
||||
}
|
||||
|
||||
void
|
||||
check_gold_symbol()
|
||||
{
|
||||
nhsym goldch = showsyms[COIN_CLASS + SYM_OFF_O];
|
||||
|
||||
iflags.invis_goldsym = (goldch <= (nhsym) ' ');
|
||||
}
|
||||
|
||||
char *
|
||||
do_statusline1()
|
||||
{
|
||||
@@ -86,17 +94,6 @@ do_statusline1()
|
||||
return newbot1;
|
||||
}
|
||||
|
||||
void
|
||||
check_gold_symbol()
|
||||
{
|
||||
int goldch, goldoc;
|
||||
unsigned int goldos;
|
||||
int goldglyph = objnum_to_glyph(GOLD_PIECE);
|
||||
|
||||
(void) mapglyph(goldglyph, &goldch, &goldoc, &goldos, 0, 0);
|
||||
iflags.invis_goldsym = ((char) goldch <= ' ');
|
||||
}
|
||||
|
||||
char *
|
||||
do_statusline2()
|
||||
{
|
||||
@@ -125,7 +122,7 @@ do_statusline2()
|
||||
money = 0L; /* ought to issue impossible() and then discard gold */
|
||||
Sprintf(eos(dloc), "%s:%-2ld", /* strongest hero can lift ~300000 gold */
|
||||
(iflags.in_dumplog || iflags.invis_goldsym) ? "$"
|
||||
: encglyph(objnum_to_glyph(GOLD_PIECE)),
|
||||
: encglyph(objnum_to_glyph(GOLD_PIECE)),
|
||||
min(money, 999999L));
|
||||
dln = strlen(dloc);
|
||||
/* '$' encoded as \GXXXXNNNN is 9 chars longer than display will need */
|
||||
@@ -586,7 +583,8 @@ bot_via_windowport()
|
||||
* sequence.
|
||||
*/
|
||||
Sprintf(g.blstats[idx][BL_GOLD].val, "%s:%ld",
|
||||
encglyph(objnum_to_glyph(GOLD_PIECE)),
|
||||
(iflags.in_dumplog || iflags.invis_goldsym) ? "$"
|
||||
: encglyph(objnum_to_glyph(GOLD_PIECE)),
|
||||
g.blstats[idx][BL_GOLD].a.a_long);
|
||||
g.valset[BL_GOLD] = TRUE; /* indicate val already set */
|
||||
|
||||
@@ -690,8 +688,7 @@ boolean *valsetlist;
|
||||
*
|
||||
* Also, even if g.context.rndencode hasn't changed and the
|
||||
* gold amount itself hasn't changed, the glyph portion of the
|
||||
* encoding may have changed if a new symset was put into
|
||||
* effect.
|
||||
* encoding may have changed if a new symset was put into effect.
|
||||
*
|
||||
* \GXXXXNNNN:25
|
||||
* XXXX = the g.context.rndencode portion
|
||||
@@ -714,7 +711,7 @@ boolean *valsetlist;
|
||||
if (!g.update_all && !chg) {
|
||||
reset = hilite_reset_needed(prev, g.bl_hilite_moves);
|
||||
if (reset)
|
||||
curr->time = prev->time = 0L;
|
||||
curr->time = prev->time = 0L;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 end.c $NHDT-Date: 1545646111 2018/12/24 10:08:31 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.160 $ */
|
||||
/* NetHack 3.6 end.c $NHDT-Date: 1545771927 2018/12/25 21:05:27 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.161 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2012. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -1534,12 +1534,7 @@ boolean identified, all_containers, reportempty;
|
||||
{
|
||||
register struct obj *box, *obj;
|
||||
char buf[BUFSZ];
|
||||
boolean cat,
|
||||
dumping =
|
||||
#ifdef DUMPLOG
|
||||
iflags.in_dumplog ? TRUE :
|
||||
#endif
|
||||
FALSE;
|
||||
boolean cat, dumping = iflags.in_dumplog;
|
||||
|
||||
for (box = list; box; box = box->nobj) {
|
||||
if (Is_container(box) || box->otyp == STATUE) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 files.c $NHDT-Date: 1543395733 2018/11/28 09:02:13 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.244 $ */
|
||||
/* NetHack 3.6 files.c $NHDT-Date: 1545702598 2018/12/25 01:49:58 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.248 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Derek S. Ray, 2015. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -2994,7 +2994,8 @@ boolean FDECL((*proc), (char *));
|
||||
*ep = '\0';
|
||||
|
||||
/* trim off spaces at end of line */
|
||||
while (--ep >= inbuf && (*ep == ' ' || *ep == '\t' || *ep == '\r'))
|
||||
while (--ep >= inbuf
|
||||
&& (*ep == ' ' || *ep == '\t' || *ep == '\r'))
|
||||
*ep = '\0';
|
||||
|
||||
if (!config_error_nextline(inbuf)) {
|
||||
@@ -3132,9 +3133,7 @@ int which_set;
|
||||
config_error_add("Missing finish for symset \"%s\"",
|
||||
g.symset[which_set].name ? g.symset[which_set].name
|
||||
: "unknown");
|
||||
|
||||
config_error_done();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
11
src/objnam.c
11
src/objnam.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 objnam.c $NHDT-Date: 1544520422 2018/12/11 09:27:02 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.230 $ */
|
||||
/* NetHack 3.6 objnam.c $NHDT-Date: 1545774525 2018/12/25 21:48:45 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.231 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2011. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -1205,10 +1205,15 @@ unsigned doname_flags;
|
||||
obj->unpaid ? "unpaid" : "contents",
|
||||
quotedprice, currency(quotedprice));
|
||||
} else if (with_price) {
|
||||
long price = get_cost_of_shop_item(obj);
|
||||
long price = get_cost_of_shop_item(obj); /* updates obj->ox,oy */
|
||||
|
||||
if (price > 0)
|
||||
if (price > 0L)
|
||||
Sprintf(eos(bp), " (%ld %s)", price, currency(price));
|
||||
else if (obj->no_charge /* only set for items on shop floor */
|
||||
&& *u.ushops /* but make sure hero is inside same shop */
|
||||
&& (*in_rooms(u.ux, u.uy, SHOPBASE)
|
||||
== *in_rooms(obj->ox, obj->oy, SHOPBASE)))
|
||||
Strcat(bp, " (no charge)");
|
||||
}
|
||||
if (!strncmp(prefix, "a ", 2)) {
|
||||
/* save current prefix, without "a "; might be empty */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 pager.c $NHDT-Date: 1545595360 2018/12/23 20:02:40 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.144 $ */
|
||||
/* NetHack 3.6 pager.c $NHDT-Date: 1545774524 2018/12/25 21:48:44 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.145 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2018. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -223,7 +223,8 @@ int x, y, glyph;
|
||||
|
||||
if (otmp) {
|
||||
Strcpy(buf, (otmp->otyp != STRANGE_OBJECT)
|
||||
? distant_name(otmp, doname_vague_quan)
|
||||
? distant_name(otmp, otmp->dknown ? doname_with_price
|
||||
: doname_vague_quan)
|
||||
: obj_descr[STRANGE_OBJECT].oc_name);
|
||||
if (fakeobj)
|
||||
dealloc_obj(otmp), otmp = 0;
|
||||
|
||||
25
src/shk.c
25
src/shk.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 shk.c $NHDT-Date: 1545383616 2018/12/21 09:13:36 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.144 $ */
|
||||
/* NetHack 3.6 shk.c $NHDT-Date: 1545774524 2018/12/25 21:48:44 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.145 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2012. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -920,7 +920,7 @@ register struct obj *obj, *merge;
|
||||
if (onbill(obj, shkp, TRUE))
|
||||
break;
|
||||
}
|
||||
/* sanity check, more or less */
|
||||
/* sanity check, in case obj is on bill but not marked 'unpaid' */
|
||||
if (!shkp)
|
||||
shkp = shop_keeper(*u.ushops);
|
||||
/*
|
||||
@@ -1956,8 +1956,8 @@ unsigned id;
|
||||
return (struct obj *) 0;
|
||||
}
|
||||
|
||||
/* Returns the price of an arbitrary item in the shop.
|
||||
Returns 0 if the item doesn't belong to a shopkeeper. */
|
||||
/* Returns the price of an arbitrary item in the shop,
|
||||
0 if the item doesn't belong to a shopkeeper or hero is not in the shop. */
|
||||
long
|
||||
get_cost_of_shop_item(obj)
|
||||
register struct obj *obj;
|
||||
@@ -1966,16 +1966,12 @@ register struct obj *obj;
|
||||
xchar x, y;
|
||||
long cost = 0L;
|
||||
|
||||
if (*u.ushops
|
||||
&& obj->oclass != COIN_CLASS
|
||||
if (*u.ushops && obj->oclass != COIN_CLASS
|
||||
&& obj != uball && obj != uchain
|
||||
&& get_obj_location(obj, &x, &y, 0)
|
||||
&& (obj->unpaid
|
||||
|| (obj->where == OBJ_FLOOR
|
||||
&& !obj->no_charge && costly_spot(x, y)))
|
||||
&& (shkp = shop_keeper(*in_rooms(x, y, SHOPBASE))) != 0
|
||||
&& inhishop(shkp)) {
|
||||
cost = obj->quan * get_cost(obj, shkp);
|
||||
&& *in_rooms(u.ux, u.uy, SHOPBASE) == *in_rooms(x, y, SHOPBASE)
|
||||
&& (shkp = shop_keeper(inside_shop(x, y))) != 0 && inhishop(shkp)) {
|
||||
cost = obj->no_charge ? 0L : obj->quan * get_cost(obj, shkp);
|
||||
if (Has_contents(obj))
|
||||
cost += contained_cost(obj, shkp, 0L, FALSE, FALSE);
|
||||
}
|
||||
@@ -4155,9 +4151,8 @@ register struct obj *first_obj;
|
||||
for (otmp = first_obj; otmp; otmp = otmp->nexthere) {
|
||||
if (otmp->oclass == COIN_CLASS)
|
||||
continue;
|
||||
cost = (otmp->no_charge || otmp == uball || otmp == uchain)
|
||||
? 0L
|
||||
: get_cost(otmp, (struct monst *) 0);
|
||||
cost = (otmp->no_charge || otmp == uball || otmp == uchain) ? 0L
|
||||
: get_cost(otmp, shkp);
|
||||
contentsonly = !cost;
|
||||
if (Has_contents(otmp))
|
||||
cost += contained_cost(otmp, shkp, 0L, FALSE, FALSE);
|
||||
|
||||
Reference in New Issue
Block a user