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

@@ -2317,7 +2317,7 @@ set_mimic_sym(register struct monst *mtmp)
goto assign_sym;
}
} else {
s_sym = syms[rn2(SIZE(syms))];
s_sym = ROLL_FROM(syms);
assign_sym:
if (s_sym == MAXOCLASSES) {
static const int furnsyms[] = {
@@ -2326,7 +2326,7 @@ set_mimic_sym(register struct monst *mtmp)
};
ap_type = M_AP_FURNITURE;
appear = furnsyms[rn2(SIZE(furnsyms))];
appear = ROLL_FROM(furnsyms);
} else {
ap_type = M_AP_OBJECT;
if (s_sym == S_MIMIC_DEF) {