Added logic so that a unit can not attack itself.