Expands bubblesort_by_value to support datum/atom variables sorting
Fixes runtime with palmer
Fixes runtimes with Attack() of monsters