From 0e7b97cea255c43d5ee4c0119713bba136557946 Mon Sep 17 00:00:00 2001 From: Git-Nivrak <59925169+Git-Nivrak@users.noreply.github.com> Date: Thu, 18 Apr 2024 20:55:37 +0300 Subject: [PATCH] Update launching.dm --- code/modules/movement/launching/launching.dm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/modules/movement/launching/launching.dm b/code/modules/movement/launching/launching.dm index 3e188abb1067..778c452a3240 100644 --- a/code/modules/movement/launching/launching.dm +++ b/code/modules/movement/launching/launching.dm @@ -182,17 +182,21 @@ add_temp_pass_flags(pass_flags) + var/turf/start_turf = get_step_towards(src, LM.target) + var/list/turf/path = get_line(start_turf, LM.target) var/last_loc = loc var/early_exit = FALSE LM.dist = 0 - while (src && throwing && loc == last_loc && isturf(src.loc)) // While looks scary at first but it's basically just a for until LM.dist reaches LM.range + for (var/turf/T in path) + if (!src || !throwing || loc != last_loc || !isturf(src.loc)) + break if (!LM || QDELETED(LM)) early_exit = TRUE break if (LM.dist >= LM.range) break - if (!Move(get_step_towards(src, LM.target))) // If this returns FALSE, then a collision happened + if (!Move(T)) // If this returns FALSE, then a collision happened break last_loc = loc if (++LM.dist >= LM.range)