From 44c4c23337dc26d3ccef49bc85afe2f5eaf3e1dd Mon Sep 17 00:00:00 2001 From: HugoLuman Date: Thu, 19 May 2016 14:01:24 -0700 Subject: [PATCH 1/9] Stops swarmers from eating the PA or releasing the engine Fixes the erroneous typepaths that protected two unused machinery objects instead of two actual parts of the PA Stops swarmers from eating field generators. While it may have been intentional for them to eat the ones in secure storage, they could also eat the ones holding in the engine Attempts to stop swarmers from accessing the engine (and depressurizing adjacent areas) in the first place. I believe the "no breach" only checking for space turfs (rather than airless plating) was an oversight, as it would allow them to causes breaches in other areas as well --- code/game/gamemodes/miniantags/bot_swarm/swarmer.dm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm index 315e48ba983..6df5b211d87 100644 --- a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm +++ b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm @@ -170,15 +170,15 @@ /obj/structure/particle_accelerator/particle_emitter/right/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) to_chat(S, "Disrupting the power grid would bring no benefit to us. Aborting.") -/obj/structure/particle_accelerator/particle_emitter/end_cap/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) +/obj/structure/particle_accelerator/end_cap/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) to_chat(S, "Disrupting the power grid would bring no benefit to us. Aborting.") -/obj/structure/particle_accelerator/particle_emitter/power_box/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) +/obj/structure/particle_accelerator/power_box/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) to_chat(S, "Disrupting the power grid would bring no benefit to us. Aborting.") -/obj/machinery/field/generator/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) - S.DisIntegrate(src) +/obj/machinery/field/generator/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) //Why was eating this explicitly coded in? + to_chat(S, "An inhospitable area may be created as a result of destroying this object. Aborting.") /obj/machinery/gravity_generator/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) S.DisIntegrate(src) @@ -233,7 +233,7 @@ /turf/simulated/wall/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) for(var/turf/T in range(1, src)) - if(istype(T, /turf/space) || istype(T.loc, /area/space)) + if(istype(T, /turf/space) || istype(T.loc, /area/space) || istype(T, /turf/simulated/floor/plating/airless) to_chat(S, "Destroying this object has the potential to cause a hull breach. Aborting.") return ..() From 42305e9deee4775dcb6fbfb965087e421e8fa277 Mon Sep 17 00:00:00 2001 From: HugoLuman Date: Thu, 19 May 2016 14:16:11 -0700 Subject: [PATCH 2/9] Adds missing ) --- code/game/gamemodes/miniantags/bot_swarm/swarmer.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm index 6df5b211d87..f86a52a42fc 100644 --- a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm +++ b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm @@ -233,7 +233,7 @@ /turf/simulated/wall/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) for(var/turf/T in range(1, src)) - if(istype(T, /turf/space) || istype(T.loc, /area/space) || istype(T, /turf/simulated/floor/plating/airless) + if(istype(T, /turf/space) || istype(T.loc, /area/space) || istype(T, /turf/simulated/floor/plating/airless)) to_chat(S, "Destroying this object has the potential to cause a hull breach. Aborting.") return ..() From 80cfaf0793abde91d34af11b0c8b6c653e58e736 Mon Sep 17 00:00:00 2001 From: HugoLuman Date: Thu, 19 May 2016 15:41:11 -0700 Subject: [PATCH 3/9] Fixes typepath of PA parent object Corrects /obj/machinery/particle_accelerator/swarmer_act( to /obj/structure/particle_accelerator/swarmer_act( I'm guessing that whoever originally coded that missed the typepath and then added all the procs for the child objects because swarmers were still able to eat the PA Now that it's fixed, the child checks should be unnecessary --- .../gamemodes/miniantags/bot_swarm/swarmer.dm | 20 +------------------ 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm index f86a52a42fc..986d6c0cbf2 100644 --- a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm +++ b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm @@ -155,25 +155,7 @@ S.DisIntegrate(src) toggle_cam(S, 0) -/obj/machinery/particle_accelerator/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) - to_chat(S, "Disrupting the power grid would bring no benefit to us. Aborting.") - -/obj/structure/particle_accelerator/fuel_chamber/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) - to_chat(S, "Disrupting the power grid would bring no benefit to us. Aborting.") - -/obj/structure/particle_accelerator/particle_emitter/center/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) - to_chat(S, "Disrupting the power grid would bring no benefit to us. Aborting.") - -/obj/structure/particle_accelerator/particle_emitter/left/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) - to_chat(S, "Disrupting the power grid would bring no benefit to us. Aborting.") - -/obj/structure/particle_accelerator/particle_emitter/right/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) - to_chat(S, "Disrupting the power grid would bring no benefit to us. Aborting.") - -/obj/structure/particle_accelerator/end_cap/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) - to_chat(S, "Disrupting the power grid would bring no benefit to us. Aborting.") - -/obj/structure/particle_accelerator/power_box/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) +/obj/structure/particle_accelerator/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) to_chat(S, "Disrupting the power grid would bring no benefit to us. Aborting.") From 3c66a76e0a4c7274221709cfa03be0d63b5ba6b0 Mon Sep 17 00:00:00 2001 From: HugoLuman Date: Thu, 19 May 2016 16:02:43 -0700 Subject: [PATCH 4/9] Adds a (!powered) check to field generators Now they can eat the ones in storage but not the ones holding in the engine --- code/game/gamemodes/miniantags/bot_swarm/swarmer.dm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm index 986d6c0cbf2..01ce04b3d18 100644 --- a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm +++ b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm @@ -159,8 +159,9 @@ to_chat(S, "Disrupting the power grid would bring no benefit to us. Aborting.") -/obj/machinery/field/generator/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) //Why was eating this explicitly coded in? - to_chat(S, "An inhospitable area may be created as a result of destroying this object. Aborting.") +/obj/machinery/field/generator/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) + if(!powered) + to_chat(S, "An inhospitable area may be created as a result of destroying this object. Aborting.") /obj/machinery/gravity_generator/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) S.DisIntegrate(src) From 0e424a0efd1765c2627ac88efff557afec1af64b Mon Sep 17 00:00:00 2001 From: HugoLuman Date: Thu, 19 May 2016 16:06:18 -0700 Subject: [PATCH 5/9] Finishes that check with a return at the end --- code/game/gamemodes/miniantags/bot_swarm/swarmer.dm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm index 01ce04b3d18..ba37348c6fb 100644 --- a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm +++ b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm @@ -162,6 +162,8 @@ /obj/machinery/field/generator/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) if(!powered) to_chat(S, "An inhospitable area may be created as a result of destroying this object. Aborting.") + return + else S.DisIntegrate(src) /obj/machinery/gravity_generator/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) S.DisIntegrate(src) From ee438cca12c61f869b14818c81b0c468a646816e Mon Sep 17 00:00:00 2001 From: HugoLuman Date: Thu, 19 May 2016 16:09:38 -0700 Subject: [PATCH 6/9] Update swarmer.dm --- code/game/gamemodes/miniantags/bot_swarm/swarmer.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm index ba37348c6fb..a94cf2cf1fa 100644 --- a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm +++ b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm @@ -160,7 +160,7 @@ /obj/machinery/field/generator/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) - if(!powered) + if(powered) to_chat(S, "An inhospitable area may be created as a result of destroying this object. Aborting.") return else S.DisIntegrate(src) From e02222f11f0bcbaa8cd90f05d3eca4383f76e157 Mon Sep 17 00:00:00 2001 From: HugoLuman Date: Thu, 19 May 2016 17:31:35 -0700 Subject: [PATCH 7/9] Check actually works now Tested it. Hopefully that's the last commit needed. --- code/game/gamemodes/miniantags/bot_swarm/swarmer.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm index a94cf2cf1fa..8ad934391b5 100644 --- a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm +++ b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm @@ -160,10 +160,10 @@ /obj/machinery/field/generator/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) - if(powered) - to_chat(S, "An inhospitable area may be created as a result of destroying this object. Aborting.") + if(!active) + S.DisIntegrate(src) return - else S.DisIntegrate(src) + else to_chat(S, "An inhospitable area may be created as a result of destroying this object. Aborting.") /obj/machinery/gravity_generator/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) S.DisIntegrate(src) From fff7181da87776d0b5fc3193187f07d251b74f1d Mon Sep 17 00:00:00 2001 From: HugoLuman Date: Thu, 19 May 2016 17:37:14 -0700 Subject: [PATCH 8/9] Reinforces the PA protection Adds back in protection for obj/machinery/particle_accelerator and its children, since the PA console is still parented to it. --- code/game/gamemodes/miniantags/bot_swarm/swarmer.dm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm index 8ad934391b5..c28d3d65086 100644 --- a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm +++ b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm @@ -158,6 +158,8 @@ /obj/structure/particle_accelerator/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) to_chat(S, "Disrupting the power grid would bring no benefit to us. Aborting.") +/obj/machinery/particle_accelerator/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) // Since the console is still parented to this + to_chat(S, "Disrupting the power grid would bring no benefit to us. Aborting.") /obj/machinery/field/generator/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) if(!active) From 50a114116ba86fd8cf05b803caf3f8e96dea7d99 Mon Sep 17 00:00:00 2001 From: HugoLuman Date: Fri, 20 May 2016 13:17:05 -0700 Subject: [PATCH 9/9] Removes unneeded else --- code/game/gamemodes/miniantags/bot_swarm/swarmer.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm index c28d3d65086..8c4a2685e04 100644 --- a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm +++ b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm @@ -165,7 +165,7 @@ if(!active) S.DisIntegrate(src) return - else to_chat(S, "An inhospitable area may be created as a result of destroying this object. Aborting.") + to_chat(S, "An inhospitable area may be created as a result of destroying this object. Aborting.") /obj/machinery/gravity_generator/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) S.DisIntegrate(src)