anchor.diff:  				if(!in_faction(C))
   					targets += C
   
  -		if(istype(A, /obj/mecha/))
  +		if(istype(A, /obj/mecha))
   			var/obj/mecha/M = A
   			//If there is a user and they're not in our faction
   			if(M.occupant && !in_faction(M.occupant))
   				if(assess_perp(M.occupant) >= 4)
   					targets += M
   
  -	return targets
  +	if(!tryToShootAt(targets))
  +		if(!always_up)
  +			popDown() // no valid targets, close the cover
   
   /obj/machinery/porta_turret/proc/tryToShootAt(list/atom/movable/targets)
   	while(targets.len > 0)
  
positive.code: 
  /obj/machinery/porta_turret/proc/target(atom/movable/target)
  	if(target)
  		spawn()
  			popUp()				//pop the turret up if it's not already up.
  		setDir(get_dir(base, target))//even if you can't shoot, follow the target
  		spawn()
  			shootAt(target)
  		return 1
  	return
  
  
negative.code: 			popDown()
  		return
  
  	var/list/targets = list()
  	var/static/things_to_scan = typecacheof(list(/mob/living, /obj/mecha))
  
  	for(var/A in typecache_filter_list(view(scan_range, base), things_to_scan))
  		var/atom/AA = A
  
  		if(AA.invisibility > SEE_INVISIBLE_LIVING)
  			continue
  
  		if(check_anomalies)//if it's set to check for simple animals
  			if(isanimal(A))
  				var/mob/living/simple_animal/SA = A
  				if(SA.stat || in_faction(SA)) //don't target if dead or in faction
  					continue
  				targets += SA
  
  		if(iscarbon(A))
  			var/mob/living/carbon/C = A
  			//If not emagged, only target non downed carbons
  			if(mode != TURRET_LETHAL && (C.stat || C.handcuffed || C.lying))
  