Skip to content

Commit

Permalink
Fix: Juiblex could be summoned an infinite number of times
Browse files Browse the repository at this point in the history
This is due to an interaction with the code that prevents him from being
made extinct (if he was, he couldn't split). Fix this by changing the
check for a summoned demon lord to respect its born counter rather than
its extinction status (should be the same thing as long as this only
considers uniques).
  • Loading branch information
copperwater committed Apr 17, 2024
1 parent e22d688 commit a33f2a9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/minion.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,12 @@ dlord(aligntyp atyp)

for (tryct = !In_endgame(&u.uz) ? 20 : 0; tryct > 0; --tryct) {
pm = rn1(PM_YEENOGHU + 1 - PM_JUIBLEX, PM_JUIBLEX);
if (!(gm.mvitals[pm].mvflags & G_GONE)
/* This previously checked G_GONE (as dprince still does), but Juiblex
* is weird in that he splits, and in order to split he doesn't get
* G_EXTINCT set. Instead, check the born counter (which also works fine
* for Yeenoghu or any other archfiend since the outcome is the same -
* if they have already been generated, they can't be summoned. */
if (!(gm.mvitals[pm].born)
&& (atyp == A_NONE || sgn(mons[pm].maligntyp) == sgn(atyp)))
return pm;
}
Expand Down

0 comments on commit a33f2a9

Please sign in to comment.