Macro for picking random entry from array

This commit is contained in:
Pasi Kallinen
2023-12-05 10:06:27 +02:00
parent b98a70e3ec
commit 5dc94f3d83
24 changed files with 45 additions and 42 deletions

View File

@@ -109,7 +109,7 @@ msummon(struct monst *mon)
if (!rn2(6)) {
switch (atyp) { /* see summon_minion */
case A_NEUTRAL:
dtype = elementals[rn2(SIZE(elementals))];
dtype = ROLL_FROM(elementals);
break;
case A_CHAOTIC:
case A_NONE:
@@ -204,7 +204,7 @@ summon_minion(aligntyp alignment, boolean talk)
mnum = lminion();
break;
case A_NEUTRAL:
mnum = elementals[rn2(SIZE(elementals))];
mnum = ROLL_FROM(elementals);
break;
case A_CHAOTIC:
case A_NONE: