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

@@ -1546,7 +1546,7 @@ get_atkdam_type(int adtyp)
static const int rnd_breath_typ[] = {
AD_MAGM, AD_FIRE, AD_COLD, AD_SLEE,
AD_DISN, AD_ELEC, AD_DRST, AD_ACID };
return rnd_breath_typ[rn2(SIZE(rnd_breath_typ))];
return ROLL_FROM(rnd_breath_typ);
}
return adtyp;
}