Fix model_attenuation sorting.

I accidentally changed the second array passed to heap sort into a 1D
array instead of 2D. We can go back to the indexed sorting from before,
because storing a single dimension as a temporary is going to be
wasteful.