Avoid repeating the god ray

My recent change to hit and wake monsters caused a recursive
ghod_hitsu -> wakeup -> dobuzz -> buzz -> ghod_hitsu loop.
Don't call the ghod_hitsu again if the priest is already angry.
This commit is contained in:
Pasi Kallinen
2023-01-30 12:39:32 +02:00
parent 8bb1feab61
commit 8eeeec41f5

View File

@@ -3819,13 +3819,17 @@ wakeup(struct monst* mtmp, boolean via_attack)
}
finish_meating(mtmp);
if (via_attack) {
boolean was_peaceful = mtmp->mpeaceful;
if (was_sleeping)
growl(mtmp);
setmangry(mtmp, TRUE);
if (mtmp->ispriest && *in_rooms(mtmp->mx, mtmp->my, TEMPLE))
ghod_hitsu(mtmp);
if (mtmp->isshk && !*u.ushops)
hot_pursuit(mtmp);
if (was_peaceful) {
if (mtmp->ispriest && *in_rooms(mtmp->mx, mtmp->my, TEMPLE))
ghod_hitsu(mtmp);
if (mtmp->isshk && !*u.ushops)
hot_pursuit(mtmp);
}
}
}