From 71ff4608edfc36dc6b2ad165d9c9d16a74a3090b Mon Sep 17 00:00:00 2001 From: SapphicOverload <93578146+SapphicOverload@users.noreply.github.com> Date: Mon, 20 Jan 2025 22:39:25 -0500 Subject: [PATCH] Fixes runtime error when particle accelerators hit the edge of a planetary map (#22968) * that's a surprise tool that will help us later * f --- .../power/singularity/particle_accelerator/particle.dm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/modules/power/singularity/particle_accelerator/particle.dm b/code/modules/power/singularity/particle_accelerator/particle.dm index bb4307ff31f3..3744c2256902 100644 --- a/code/modules/power/singularity/particle_accelerator/particle.dm +++ b/code/modules/power/singularity/particle_accelerator/particle.dm @@ -65,7 +65,11 @@ if(QDELETED(src)) return if(!step(src,dir)) - forceMove(get_step(src,dir)) + var/next_step = get_step(src, dir) + if(!next_step) // reached the edge of the map + qdel(src) + return + forceMove(next_step) if(movement_range == 0) qdel(src) return