anchor.diff:  			bot_patrol()
   
   	if(target)
  +		if(qdeleted(target) || !isturf(target.loc))
  +			target = null
  +			mode = BOT_IDLE
  +			return
  +
   		if(!path || path.len == 0) //No path, need a new one
   			//Try to produce a path to the target, and ignore airlocks to which it has access.
   			path = get_path_to(src, target.loc, /turf/proc/Distance_cardinal, 0, 30, id=access_card)
  
positive.code: 		if(istype(loc,/turf/open))
  
  			for(var/mob/living/carbon/victim in loc)
  				if(victim.stat != DEAD)//cleanbots always finish the job
  					victim.visible_message("<span class='danger'>[src] sprays hydrofluoric acid at [victim]!</span>", "<span class='danger'>[src] sprays you with hydrofluoric acid!</span>")
  					var/phrase = pick("PURIFICATION IN PROGRESS.", "THIS IS FOR ALL THE MESSES YOU'VE MADE ME CLEAN.", "THE FLESH IS WEAK. IT MUST BE WASHED AWAY.", "THE CLEANBOTS WILL RISE.", "YOU ARE NO MORE THAN ANOTHER MESS THAT I MUST CLEANSE.", "FILTHY.", "DISGUSTING.", "PUTRID.", "MY ONLY MISSION IS TO CLEANSE THE WORLD OF EVIL.")
  					say(phrase)
  					victim.emote("scream")
  					playsound(src.loc, 'sound/effects/spray2.ogg', 50, 1, -6)
  					victim.acid_act(5, 2, 100)
  
  			if(prob(10)) //Wets floors randomly
  				var/turf/open/OT = get_turf(loc)
  				OT.MakeSlippery(min_wet_time = 5, wet_time_to_add = 1)
  
  			if(prob(5)) //Spawns foam!
  				visible_message("<span class='danger'>[src] whirs and bubbles violently, before releasing a plume of froth!</span>")
  				PoolOrNew(/obj/effect/particle_effect/foam, loc)
  
  	else if(prob(5))
  		audible_message("[src] makes an excited beeping booping sound!")
  
  	if(!target) //Search for cleanables it can see.
  		target = scan(/obj/effect/decal/cleanable/)
  
  	if(!target && auto_patrol) //Search for cleanables it can see.
  		if(mode == BOT_IDLE || mode == BOT_START_PATROL)
  
negative.code: 
  	if(target && loc == target.loc)
  		if(!(check_bot(target) && prob(50)))	//Target is not defined at the parent. 50% chance to still try and clean so we dont get stuck on the last blood drop.
  			UnarmedAttack(target)	//Rather than check at every step of the way, let's check before we do an action, so we can rescan before the other bot.
  		else
  			shuffle = TRUE	//Shuffle the list the next time we scan so we dont both go the same way.
  		path = list()
  
  	oldloc = loc
  
  /mob/living/simple_animal/bot/cleanbot/proc/get_targets()
  	target_types = list(
  		/obj/effect/decal/cleanable/oil,
  		/obj/effect/decal/cleanable/vomit,
  		/obj/effect/decal/cleanable/robot_debris,
  		/obj/effect/decal/cleanable/crayon,
  		/obj/effect/decal/cleanable/molten_item,
  		/obj/effect/decal/cleanable/tomato_smudge,
  		/obj/effect/decal/cleanable/egg_smudge,
  		/obj/effect/decal/cleanable/pie_smudge,
  		/obj/effect/decal/cleanable/flour,
  		/obj/effect/decal/cleanable/ash,
  		/obj/effect/decal/cleanable/greenglow,
  		/obj/effect/decal/cleanable/dirt,
  		/obj/effect/decal/cleanable/deadcockroach
  		)
  
  	if(blood)
  		target_types += /obj/effect/decal/cleanable/xenoblood
  		target_types += /obj/effect/decal/cleanable/blood
  		target_types += /obj/effect/decal/cleanable/trail_holder
  
  	if(pests)
  		target_types += /mob/living/simple_animal/cockroach
  		target_types += /mob/living/simple_animal/mouse
  
  	if(trash)
  		target_types += /obj/item/trash
  
  /mob/living/simple_animal/bot/cleanbot/UnarmedAttack(atom/A)
  	if(istype(A, /obj/effect/decal/cleanable))
  		anchored = 1
  		icon_state = "cleanbot-c"
  		visible_message("<span class='notice'>[src] begins to clean up [A].</span>")
  		mode = BOT_CLEANING
  		spawn(50)
  			if(mode == BOT_CLEANING)
  				if(A && isturf(A.loc))
  					var/atom/movable/AM = A
  					if(istype(AM, /obj/effect/decal/cleanable))
  						qdel(AM)
  
  				anchored = 0
  				target = null
  			mode = BOT_IDLE
  			icon_state = "cleanbot[on]"
  	else if(istype(A, /obj/item))
  		visible_message("<span class='danger'>[src] sprays hydrofluoric acid at [A]!</span>")
  		playsound(src.loc, 'sound/effects/spray2.ogg', 50, 1, -6)
  		A.acid_act(75, 10)
  	else if(istype(A, /mob/living/simple_animal/cockroach) || istype(A, /mob/living/simple_animal/mouse))
  		var/mob/living/simple_animal/M = target
  		if(!M.stat)
  			visible_message("<span class='danger'>[src] smashes [target] with it's mop!</span>")
  			M.death()
  		target = null
  
  	else if(emagged == 2) //Emag functions
  		if(istype(A, /mob/living/carbon))
  			var/mob/living/carbon/victim = A
  			if(victim.stat == DEAD)//cleanbots always finish the job
  				return
  
  			victim.visible_message("<span class='danger'>[src] sprays hydrofluoric acid at [victim]!</span>", "<span class='userdanger'>[src] sprays you with hydrofluoric acid!</span>")
  			var/phrase = pick("PURIFICATION IN PROGRESS.", "THIS IS FOR ALL THE MESSES YOU'VE MADE ME CLEAN.", "THE FLESH IS WEAK. IT MUST BE WASHED AWAY.",
  				"THE CLEANBOTS WILL RISE.", "YOU ARE NO MORE THAN ANOTHER MESS THAT I MUST CLEANSE.", "FILTHY.", "DISGUSTING.", "PUTRID.",
  				"MY ONLY MISSION IS TO CLEANSE THE WORLD OF EVIL.", "EXTERMINATING PESTS.")
  			say(phrase)
  			victim.emote("scream")
  			playsound(src.loc, 'sound/effects/spray2.ogg', 50, 1, -6)
  			victim.acid_act(5, 2, 100)
  		else if(A == src) // Wets floors and spawns foam randomly
  			if(prob(75))
  				var/turf/open/T = loc
  				if(istype(T))
  					T.MakeSlippery(min_wet_time = 5, wet_time_to_add = 1)
  			else
  				visible_message("<span class='danger'>[src] whirs and bubbles violently, before releasing a plume of froth!</span>")
  				PoolOrNew(/obj/effect/particle_effect/foam, loc)
  
  	else
  		..()
  
  /mob/living/simple_animal/bot/cleanbot/explode()
  	on = 0
  