Don't make callers responsible for losestr death
Remove callers' responsibility to deal with possible hero death when calling losestr. This is less fragile and error-prone than leaving it in the caller's hands, but it means that death from the monster spell 'weaken target' no longer goes through done_in_by, and the death reason is no longer "killed by <monster name>".
This commit is contained in:
11
src/eat.c
11
src/eat.c
@@ -1815,9 +1815,9 @@ eatcorpse(struct obj *otmp)
|
||||
tp++;
|
||||
pline("Ecch - that must have been poisonous!");
|
||||
if (!Poison_resistance) {
|
||||
losestr(rnd(4));
|
||||
losehp(rnd(15), !glob ? "poisonous corpse" : "poisonous glob",
|
||||
KILLED_BY_AN);
|
||||
const char *knam = !glob ? "poisonous corpse" : "poisonous glob";
|
||||
losestr(rnd(4), knam, KILLED_BY_AN);
|
||||
losehp(rnd(15), knam, KILLED_BY_AN);
|
||||
} else
|
||||
You("seem unaffected by the poison.");
|
||||
|
||||
@@ -2753,8 +2753,9 @@ doeat(void)
|
||||
if (otmp->oclass == WEAPON_CLASS && otmp->opoisoned) {
|
||||
pline("Ecch - that must have been poisonous!");
|
||||
if (!Poison_resistance) {
|
||||
losestr(rnd(4));
|
||||
losehp(rnd(15), xname(otmp), KILLED_BY_AN);
|
||||
const char *knam = xname(otmp);
|
||||
losestr(rnd(4), knam, KILLED_BY_AN);
|
||||
losehp(rnd(15), knam, KILLED_BY_AN);
|
||||
} else
|
||||
You("seem unaffected by the poison.");
|
||||
} else if (!nodelicious) {
|
||||
|
||||
Reference in New Issue
Block a user