correct coding typo: nx instead of ny
Prevented proper migration of obj dropped down the stairs. Also, don't include your attached chain when counting drop impacts.
This commit is contained in:
+18
-11
@@ -18,7 +18,7 @@ static void FDECL(kick_monster, (struct monst *, XCHAR_P, XCHAR_P));
|
|||||||
static int FDECL(kick_object, (XCHAR_P, XCHAR_P, char *));
|
static int FDECL(kick_object, (XCHAR_P, XCHAR_P, char *));
|
||||||
static int FDECL(really_kick_object, (XCHAR_P, XCHAR_P));
|
static int FDECL(really_kick_object, (XCHAR_P, XCHAR_P));
|
||||||
static char *FDECL(kickstr, (char *, const char *));
|
static char *FDECL(kickstr, (char *, const char *));
|
||||||
static void FDECL(otransit_msg, (struct obj *, BOOLEAN_P, long));
|
static void FDECL(otransit_msg, (struct obj *, BOOLEAN_P, BOOLEAN_P, long));
|
||||||
static void FDECL(drop_to, (coord *, SCHAR_P, XCHAR_P, XCHAR_P));
|
static void FDECL(drop_to, (coord *, SCHAR_P, XCHAR_P, XCHAR_P));
|
||||||
|
|
||||||
static const char kick_passes_thru[] = "kick passes harmlessly through";
|
static const char kick_passes_thru[] = "kick passes harmlessly through";
|
||||||
@@ -1510,7 +1510,7 @@ boolean shop_floor_obj;
|
|||||||
coord cc;
|
coord cc;
|
||||||
struct obj *obj;
|
struct obj *obj;
|
||||||
struct trap *t;
|
struct trap *t;
|
||||||
boolean nodrop, unpaid, container, impact = FALSE;
|
boolean nodrop, unpaid, container, impact = FALSE, chainthere = FALSE;
|
||||||
long n = 0L;
|
long n = 0L;
|
||||||
|
|
||||||
if (!otmp)
|
if (!otmp)
|
||||||
@@ -1530,9 +1530,12 @@ boolean shop_floor_obj;
|
|||||||
unpaid = is_unpaid(otmp);
|
unpaid = is_unpaid(otmp);
|
||||||
|
|
||||||
if (OBJ_AT(x, y)) {
|
if (OBJ_AT(x, y)) {
|
||||||
for (obj = g.level.objects[x][y]; obj; obj = obj->nexthere)
|
for (obj = g.level.objects[x][y]; obj; obj = obj->nexthere) {
|
||||||
if (obj != otmp)
|
if (obj == uchain)
|
||||||
|
chainthere = TRUE;
|
||||||
|
else if (obj != otmp)
|
||||||
n += obj->quan;
|
n += obj->quan;
|
||||||
|
}
|
||||||
if (n)
|
if (n)
|
||||||
impact = TRUE;
|
impact = TRUE;
|
||||||
}
|
}
|
||||||
@@ -1546,7 +1549,7 @@ boolean shop_floor_obj;
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (cansee(x, y))
|
if (cansee(x, y))
|
||||||
otransit_msg(otmp, nodrop, n);
|
otransit_msg(otmp, nodrop, chainthere, n);
|
||||||
|
|
||||||
if (nodrop) {
|
if (nodrop) {
|
||||||
if (impact)
|
if (impact)
|
||||||
@@ -1665,7 +1668,7 @@ boolean near_hero;
|
|||||||
case MIGR_SSTAIRS:
|
case MIGR_SSTAIRS:
|
||||||
if ((stway = stairway_find_from(&fromdlev, isladder)) != 0) {
|
if ((stway = stairway_find_from(&fromdlev, isladder)) != 0) {
|
||||||
nx = stway->sx;
|
nx = stway->sx;
|
||||||
nx = stway->sy;
|
ny = stway->sy;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MIGR_WITH_HERO:
|
case MIGR_WITH_HERO:
|
||||||
@@ -1766,9 +1769,9 @@ unsigned long deliverflags;
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
otransit_msg(otmp, nodrop, num)
|
otransit_msg(otmp, nodrop, chainthere, num)
|
||||||
register struct obj *otmp;
|
register struct obj *otmp;
|
||||||
register boolean nodrop;
|
boolean nodrop, chainthere;
|
||||||
long num;
|
long num;
|
||||||
{
|
{
|
||||||
char *optr = 0, obuf[BUFSZ], xbuf[BUFSZ];
|
char *optr = 0, obuf[BUFSZ], xbuf[BUFSZ];
|
||||||
@@ -1782,11 +1785,15 @@ long num;
|
|||||||
}
|
}
|
||||||
Strcpy(obuf, optr);
|
Strcpy(obuf, optr);
|
||||||
|
|
||||||
if (num) { /* means: other objects are impacted */
|
if (num || chainthere) {
|
||||||
/* As of 3.6.2: use a separate buffer for the suffix to avoid risk of
|
/* As of 3.6.2: use a separate buffer for the suffix to avoid risk of
|
||||||
overrunning obuf[] (let pline() handle truncation if necessary) */
|
overrunning obuf[] (let pline() handle truncation if necessary) */
|
||||||
Sprintf(xbuf, " %s %s object%s", otense(otmp, "hit"),
|
if (num) { /* means: other objects are impacted */
|
||||||
(num == 1L) ? "another" : "other", (num > 1L) ? "s" : "");
|
Sprintf(xbuf, " %s %s object%s", otense(otmp, "hit"),
|
||||||
|
(num == 1L) ? "another" : "other", (num > 1L) ? "s" : "");
|
||||||
|
} else { /* chain-only msg */
|
||||||
|
Sprintf(xbuf, " %s your chain", otense(otmp, "rattle"));
|
||||||
|
}
|
||||||
if (nodrop)
|
if (nodrop)
|
||||||
Sprintf(eos(xbuf), ".");
|
Sprintf(eos(xbuf), ".");
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user