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

@@ -1910,7 +1910,7 @@ static const int treefruits[] = {
struct obj *
rnd_treefruit_at(coordxy x, coordxy y)
{
return mksobj_at(treefruits[rn2(SIZE(treefruits))], x, y, TRUE, FALSE);
return mksobj_at(ROLL_FROM(treefruits), x, y, TRUE, FALSE);
}
/* create a stack of N gold pieces; never returns Null */