The bases[] array allows finding the index of the first object in a particular class. Extend it so that bases[class + 1] - 1 is a reliable way to find the last object in any class. The array had to be extended by one so that the last class has a [class+1] entry available, and object initialization now makes sure that classes within objects[] are in ascending order so that [class+1] always holds a higher index than [class].
38 KiB
38 KiB