Make is_illegal_melee_attack a static function.