Closed sgrunt closed 3 months ago
Hm. I think this change actually reveals another underlying problem with this section of code; quartz flasks are omitted from that switch statement entirely, despite being taken into consideration when calculating the ratios above.
Thanks for looking into this!
…or quartz flasks in item shuffling
rand()%N
returns a random number from 0 to N-1. In this block in Heretic's p_setup.c, there are two blocks withrand()%2
andcase 0: [...] case 1: [...] case 2: [...]
andrand()%6
with cases going up to 6, causing both of the last cases (Ethereal Arrows and Quartz Flasks) to never be rolled for item shuffle replacement. This change fixes both of these off-by-one errors to ensure both of those items can spawn.