Skip to content

Commit

Permalink
Fix: Gnomes could give multiple messages for noticing eggs or notice …
Browse files Browse the repository at this point in the history
…them after death.
  • Loading branch information
elunna committed Oct 25, 2023
1 parent 0b2030a commit 1f6e417
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions src/mon.c
Original file line number Diff line number Diff line change
Expand Up @@ -4687,22 +4687,6 @@ int xkill_flags; /* 1: suppress message, 2: suppress corpse, 4: pacifist */
mtmp->former_rank.mnum,
mtmp->former_rank.female));
}
if (is_gnome(mtmp->data) && !is_undead(mtmp->data)) {
if (!rn2(25) && !(mtmp->mflee || mtmp->msleeping
|| mtmp->mstun || mtmp->mconf || mtmp->mfrozen)) {
for (otmp = invent; otmp; otmp = otmp->nobj) {
if (otmp->otyp == EGG && otmp->corpsenm == NON_PM) {
if (canseemon(mtmp))
pline("%s looks at you and is immediately agitated.",
Monnam(mtmp));
if (!Deaf)
verbalize("Ahhhh! Eggs! %s has eggs!!",
(flags.female) ? "She" : "He");
monflee(mtmp, d(2, 6) + 10, TRUE, TRUE);
}
}
}
}
}

/* changes the monster into a stone monster of the same type
Expand Down Expand Up @@ -5050,6 +5034,7 @@ void
m_respond(mtmp)
struct monst *mtmp;
{
struct obj *otmp;
int i;
if (mtmp->data->msound == MS_SHRIEK) {
if (!Deaf && !(uarmh && uarmh->otyp == TOQUE)) {
Expand Down Expand Up @@ -5100,6 +5085,24 @@ struct monst *mtmp;
break;
}
}

if (is_gnome(mtmp->data) && !is_undead(mtmp->data)) {
if (!rn2(25) && !(mtmp->mflee || mtmp->msleeping
|| mtmp->mstun || mtmp->mconf || mtmp->mfrozen)) {
for (otmp = invent; otmp; otmp = otmp->nobj) {
if (otmp->otyp == EGG && otmp->corpsenm == NON_PM) {
if (canseemon(mtmp))
pline("%s looks at you and is immediately agitated.",
Monnam(mtmp));
if (!Deaf)
verbalize("Ahhhh! Eggs! %s has eggs!!",
(flags.female) ? "She" : "He");
monflee(mtmp, d(2, 6) + 10, TRUE, TRUE);
break;
}
}
}
}
/* Frightful presence! */
boolean roaring_dragon = mtmp->data->msound == MS_MEGAROAR
&& !mtmp->mpeaceful
Expand Down

0 comments on commit 1f6e417

Please sign in to comment.