stack splitting vs shop prices
I misread part of the original code and the revision introduced a bug based on that. obj->o_id price variations are used for all types of non-IDed items, not just non-glass gems.
This commit is contained in:
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 mkobj.c $NHDT-Date: 1545948759 2018/12/27 22:12:39 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.138 $ */
|
/* NetHack 3.6 mkobj.c $NHDT-Date: 1545951660 2018/12/27 23:01:00 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.139 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Derek S. Ray, 2015. */
|
/*-Copyright (c) Derek S. Ray, 2015. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -465,8 +465,8 @@ long num;
|
|||||||
return otmp;
|
return otmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* when splitting a stack that has o_id-based shop prices (non-glass gems),
|
/* when splitting a stack that has o_id-based shop prices, pick an
|
||||||
pick an o_id value for the new stack that will maintain the same price */
|
o_id value for the new stack that will maintain the same price */
|
||||||
STATIC_OVL unsigned
|
STATIC_OVL unsigned
|
||||||
nextoid(oldobj, newobj)
|
nextoid(oldobj, newobj)
|
||||||
struct obj *oldobj, *newobj;
|
struct obj *oldobj, *newobj;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 shk.c $NHDT-Date: 1545948761 2018/12/27 22:12:41 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.148 $ */
|
/* NetHack 3.6 shk.c $NHDT-Date: 1545951668 2018/12/27 23:01:08 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.149 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Robert Patrick Rankin, 2012. */
|
/*-Copyright (c) Robert Patrick Rankin, 2012. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -1993,10 +1993,8 @@ unsigned oid;
|
|||||||
{
|
{
|
||||||
int res = 0, otyp = obj->otyp;
|
int res = 0, otyp = obj->otyp;
|
||||||
|
|
||||||
/* currently only used for non-glass gems */
|
if (!(obj->dknown && objects[otyp].oc_name_known)
|
||||||
if (obj->oclass == GEM_CLASS && otyp != ROCK
|
&& (obj->oclass != GEM_CLASS || objects[otyp].oc_material != GLASS)) {
|
||||||
&& !(obj->dknown && objects[otyp].oc_name_known)
|
|
||||||
&& objects[otyp].oc_material != GLASS) {
|
|
||||||
res = ((oid % 4) == 0); /* id%4 ==0 -> +1, ==1..3 -> 0 */
|
res = ((oid % 4) == 0); /* id%4 ==0 -> +1, ==1..3 -> 0 */
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
|
|||||||
Reference in New Issue
Block a user