steed corpse
Fix the problem From a bug report. Presumeably the corpse exclusion at <u.ux,u.uy>
was intended to be for killing your way out of an engulfer, but there wasn't
any comment to that effect. The exclusion still applies if you were inside
the monster when it died; ridden steed is the only other way I can think of
to have a monster die at your location, so it should be the only case which
gets affected. Neither steed nor engulfer is allowed to generate a random
item when upon death; you already know what was carried in those cases.
The bulk of the diff is from reorganizing the relevant `if' and
subsequent indentation changes.
This commit is contained in:
@@ -137,6 +137,7 @@ fix up grammar and punctuation in variants of shopkeeper's price message
|
|||||||
regression, bug fixed in 3.4.1 reintroduced in 3.4.3: Sunsword continued to
|
regression, bug fixed in 3.4.1 reintroduced in 3.4.3: Sunsword continued to
|
||||||
emit light after monster who was wielding got killed
|
emit light after monster who was wielding got killed
|
||||||
weaken "farming" strategy
|
weaken "farming" strategy
|
||||||
|
don't suppress corpse if you kill your own steed
|
||||||
|
|
||||||
|
|
||||||
Platform- and/or Interface-Specific Fixes
|
Platform- and/or Interface-Specific Fixes
|
||||||
|
|||||||
84
src/mon.c
84
src/mon.c
@@ -1800,19 +1800,17 @@ register struct monst *mtmp;
|
|||||||
/* the player has killed the monster mtmp */
|
/* the player has killed the monster mtmp */
|
||||||
void
|
void
|
||||||
xkilled(mtmp, dest)
|
xkilled(mtmp, dest)
|
||||||
register struct monst *mtmp;
|
struct monst *mtmp;
|
||||||
/*
|
/*
|
||||||
* Dest=1, normal; dest=0, don't print message; dest=2, don't drop corpse
|
* Dest=1, normal; dest=0, don't print message; dest=2, don't drop corpse
|
||||||
* either; dest=3, message but no corpse
|
* either; dest=3, message but no corpse
|
||||||
*/
|
*/
|
||||||
int dest;
|
int dest;
|
||||||
{
|
{
|
||||||
register int tmp, x = mtmp->mx, y = mtmp->my;
|
int tmp, mndx, x = mtmp->mx, y = mtmp->my;
|
||||||
register struct permonst *mdat;
|
struct permonst *mdat;
|
||||||
int mndx;
|
struct obj *otmp;
|
||||||
register struct obj *otmp;
|
struct trap *t;
|
||||||
register struct trap *t;
|
|
||||||
boolean redisp = FALSE;
|
|
||||||
boolean wasinside = u.uswallow && (u.ustuck == mtmp);
|
boolean wasinside = u.uswallow && (u.ustuck == mtmp);
|
||||||
boolean burycorpse = FALSE;
|
boolean burycorpse = FALSE;
|
||||||
|
|
||||||
@@ -1881,52 +1879,48 @@ xkilled(mtmp, dest)
|
|||||||
#ifdef MAIL
|
#ifdef MAIL
|
||||||
if(mdat == &mons[PM_MAIL_DAEMON]) {
|
if(mdat == &mons[PM_MAIL_DAEMON]) {
|
||||||
stackobj(mksobj_at(SCR_MAIL, x, y, FALSE, FALSE));
|
stackobj(mksobj_at(SCR_MAIL, x, y, FALSE, FALSE));
|
||||||
redisp = TRUE;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if((!accessible(x, y) && !is_pool(x, y)) ||
|
if (accessible(x, y) || is_pool(x, y)) {
|
||||||
(x == u.ux && y == u.uy)) {
|
struct obj *cadaver;
|
||||||
/* might be mimic in wall or corpse in lava or on player's spot */
|
int otyp;
|
||||||
redisp = TRUE;
|
|
||||||
if(wasinside) spoteffects(TRUE);
|
/* illogical but traditional "treasure drop" */
|
||||||
} else if(x != u.ux || y != u.uy) {
|
if (!rn2(6) && !(mvitals[mndx].mvflags & G_NOCORPSE) &&
|
||||||
/* might be here after swallowed */
|
/* no extra item from swallower or steed */
|
||||||
if (!rn2(6) && !(mvitals[mndx].mvflags & G_NOCORPSE) &&
|
(x != u.ux || y != u.uy) &&
|
||||||
#ifdef KOPS
|
#ifdef KOPS
|
||||||
|
/* no extra item from kops--too easy to abuse */
|
||||||
mdat->mlet != S_KOP &&
|
mdat->mlet != S_KOP &&
|
||||||
#endif
|
#endif
|
||||||
|
/* reduced chance of item from cloned monster */
|
||||||
(!mtmp->mcloned || !rn2(mvitals[mndx].died / 5 + 1))) {
|
(!mtmp->mcloned || !rn2(mvitals[mndx].died / 5 + 1))) {
|
||||||
int typ;
|
otmp = mkobj_at(RANDOM_CLASS, x, y, TRUE);
|
||||||
|
/* don't create large objects from small monsters */
|
||||||
otmp = mkobj_at(RANDOM_CLASS, x, y, TRUE);
|
otyp = otmp->otyp;
|
||||||
/* Don't create large objects from small monsters */
|
if (mdat->msize < MZ_HUMAN && otyp != FOOD_RATION &&
|
||||||
typ = otmp->otyp;
|
otyp != LEASH && otyp != FIGURINE &&
|
||||||
if (mdat->msize < MZ_HUMAN && typ != FOOD_RATION
|
(otmp->owt > 3 ||
|
||||||
&& typ != LEASH
|
objects[otyp].oc_big /*oc_bimanual/oc_bulky*/ ||
|
||||||
&& typ != FIGURINE
|
is_spear(otmp) || is_pole(otmp) ||
|
||||||
&& (otmp->owt > 3 ||
|
otyp == MORNING_STAR)) {
|
||||||
objects[typ].oc_big /*oc_bimanual/oc_bulky*/ ||
|
delobj(otmp);
|
||||||
is_spear(otmp) || is_pole(otmp) ||
|
|
||||||
typ == MORNING_STAR)) {
|
|
||||||
delobj(otmp);
|
|
||||||
} else redisp = TRUE;
|
|
||||||
}
|
}
|
||||||
/* Whether or not it always makes a corpse is, in theory,
|
}
|
||||||
* different from whether or not the corpse is "special";
|
/* corpse--none if hero was inside the monster */
|
||||||
* if we want both, we have to specify it explicitly.
|
if (!wasinside && corpse_chance(mtmp, (struct monst *)0, FALSE)) {
|
||||||
*/
|
cadaver = make_corpse(mtmp, burycorpse ?
|
||||||
if (corpse_chance(mtmp, (struct monst *)0, FALSE)) {
|
CORPSTAT_BURIED : CORPSTAT_NONE);
|
||||||
struct obj *cadaver = make_corpse(mtmp, burycorpse ?
|
if (burycorpse && cadaver && cansee(x,y) && !mtmp->minvis &&
|
||||||
CORPSTAT_BURIED : CORPSTAT_NONE);
|
cadaver->where == OBJ_BURIED && (dest & 1)) {
|
||||||
if (burycorpse && cadaver && cansee(x,y) &&
|
pline("%s corpse ends up buried.", s_suffix(Monnam(mtmp)));
|
||||||
!mtmp->minvis &&
|
|
||||||
cadaver->where == OBJ_BURIED && (dest & 1)) {
|
|
||||||
pline("%s corpse ends up buried.",
|
|
||||||
s_suffix(Monnam(mtmp)));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(redisp) newsym(x,y);
|
if (wasinside) spoteffects(TRUE); /* poor man's expels() */
|
||||||
|
/* monster is gone, corpse or other object might now be visible */
|
||||||
|
newsym(x, y);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
/* punish bad behaviour */
|
/* punish bad behaviour */
|
||||||
if(is_human(mdat) && (!always_hostile(mdat) && mtmp->malign <= 0) &&
|
if(is_human(mdat) && (!always_hostile(mdat) && mtmp->malign <= 0) &&
|
||||||
|
|||||||
Reference in New Issue
Block a user