Fix PrimaryWeaponPriorityTarget and DronePriorityTarget routines

this needs testing, but should be MUCH better.