Role selection is insanely complex. I had to use a debugger to force the relevant routine to be executed. The analysis was correct: it could use rn2(14) to pick a role (valid values 0 through 12) and randomly getting 13 would lead to a crash. The terminating element of roles[] passes all the ok_role(), ok_race(), etc tests. Explicitly exclude that element when collecting the roles to choose from.
14 KiB
14 KiB