Skip to content

Commit

Permalink
[MIRROR] Add a bounds check to prevent runtimes on the ripple shuttle…
Browse files Browse the repository at this point in the history
… port [MDB IGNORE] (#865)

* Add a bounds check to prevent runtimes on the ripple shuttle port (#79959)

---------

Co-authored-by: SkyratBot <[email protected]>
Co-authored-by: oranges <[email protected]>
  • Loading branch information
3 people authored Nov 28, 2023
1 parent 79c379b commit 0eaed15
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions code/modules/shuttle/shuttle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -831,12 +831,10 @@
var/list/L1 = return_ordered_turfs(S1.x, S1.y, S1.z, S1.dir)

var/list/ripple_turfs = list()

for(var/i in 1 to L0.len)
var/stop = min(L0.len, L1.len)
for(var/i in 1 to stop)
var/turf/T0 = L0[i]
var/turf/T1 = L1[i]
if(!T0 || !T1)
continue // out of bounds
if(!istype(T0.loc, area_type) || istype(T0.loc, /area/shuttle/transit))
continue // not part of the shuttle
ripple_turfs += T1
Expand Down

0 comments on commit 0eaed15

Please sign in to comment.