Move this chunk of code (lines 223 - 240) into a separate function taking a `cPickup &` param, then you won't need to cast a_Entity in every place, the code will be less dense.