From 7fb44260119563af24c6964160e926eae90c7c11 Mon Sep 17 00:00:00 2001 From: ShizCalev Date: Thu, 7 Sep 2017 06:16:48 -0400 Subject: [PATCH 1/2] Fixes swarmers breaking the SM's containment (#30426) * Fixes swamers breaking the SM * Switched checks to use get_area --- .../gamemodes/miniantags/bot_swarm/swarmer.dm | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm index bbd78ff76a..50b7c93509 100644 --- a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm +++ b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm @@ -257,10 +257,15 @@ /obj/machinery/door/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) var/isonshuttle = istype(get_area(src), /area/shuttle) for(var/turf/T in range(1, src)) - if(isspaceturf(T) || (!isonshuttle && (istype(T.loc, /area/shuttle) || istype(T.loc, /area/space))) || (isonshuttle && !istype(T.loc, /area/shuttle))) + var/area/A = get_area(T) + if(isspaceturf(T) || (!isonshuttle && (istype(A, /area/shuttle) || istype(A, /area/space))) || (isonshuttle && !istype(A, /area/shuttle))) to_chat(S, "Destroying this object has the potential to cause a hull breach. Aborting.") S.target = null return FALSE + else if(istype(A, /area/engine/supermatter)) + to_chat(S, "Disrupting the containment of a supermatter crystal would not be to our benefit. Aborting.") + S.target = null + return FALSE S.DisIntegrate(src) return TRUE @@ -344,19 +349,29 @@ /turf/closed/wall/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) var/isonshuttle = istype(loc, /area/shuttle) for(var/turf/T in range(1, src)) - if(isspaceturf(T) || (!isonshuttle && (istype(T.loc, /area/shuttle) || istype(T.loc, /area/space))) || (isonshuttle && !istype(T.loc, /area/shuttle))) + var/area/A = get_area(T) + if(isspaceturf(T) || (!isonshuttle && (istype(A, /area/shuttle) || istype(A, /area/space))) || (isonshuttle && !istype(A, /area/shuttle))) to_chat(S, "Destroying this object has the potential to cause a hull breach. Aborting.") S.target = null return TRUE + else if(istype(A, /area/engine/supermatter)) + to_chat(S, "Disrupting the containment of a supermatter crystal would not be to our benefit. Aborting.") + S.target = null + return TRUE return ..() /obj/structure/window/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) var/isonshuttle = istype(get_area(src), /area/shuttle) for(var/turf/T in range(1, src)) - if(isspaceturf(T) || (!isonshuttle && (istype(T.loc, /area/shuttle) || istype(T.loc, /area/space))) || (isonshuttle && !istype(T.loc, /area/shuttle))) + var/area/A = get_area(T) + if(isspaceturf(T) || (!isonshuttle && (istype(A, /area/shuttle) || istype(A, /area/space))) || (isonshuttle && !istype(A, /area/shuttle))) to_chat(S, "Destroying this object has the potential to cause a hull breach. Aborting.") S.target = null return TRUE + else if(istype(A, /area/engine/supermatter)) + to_chat(S, "Disrupting the containment of a supermatter crystal would not be to our benefit. Aborting.") + S.target = null + return TRUE return ..() /obj/item/stack/cable_coil/swarmer_act(mob/living/simple_animal/hostile/swarmer/S)//Wiring would be too effective as a resource