Skip to content

Commit

Permalink
Update launching.dm
Browse files Browse the repository at this point in the history
  • Loading branch information
Git-Nivrak committed Apr 18, 2024
1 parent 6f7776a commit 0e7b97c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions code/modules/movement/launching/launching.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0e7b97c

Please sign in to comment.