From fd7e8eb3bdf608606bef94ede458f85af1e1bee6 Mon Sep 17 00:00:00 2001 From: oranges Date: Wed, 28 Dec 2016 10:16:59 +1300 Subject: [PATCH] Don't redestroy a tesla ball on stop orbit (#22482) Destroy can cause the parent ball you're orbiting to also be destroyed, which calls stop orbit on your ball, which then caused you to get destroyed again, this fixes that while still guarding against the case the original !loc qdel code was added for - see pr #15486 --- code/modules/power/tesla/energy_ball.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/power/tesla/energy_ball.dm b/code/modules/power/tesla/energy_ball.dm index 5586ab59435..6298b83fd3d 100644 --- a/code/modules/power/tesla/energy_ball.dm +++ b/code/modules/power/tesla/energy_ball.dm @@ -145,7 +145,7 @@ var/list/blacklisted_tesla_types = typecacheof(list(/obj/machinery/atmospherics, orbitingball.orbiting_balls -= src orbitingball.dissipate_strength = orbitingball.orbiting_balls.len ..() - if (!loc) + if (!loc && !qdeleted(src)) qdel(src)