Prevent infinite loops in orbit checks
This commit is contained in:
committed by
CitadelStationBot
parent
48e0c47410
commit
0b9ffdd3e3
@@ -33,7 +33,9 @@
|
||||
orbiting = null
|
||||
return ..()
|
||||
|
||||
/datum/orbit/proc/Check(turf/targetloc)
|
||||
/datum/orbit/proc/Check(turf/targetloc, list/checked_already = list())
|
||||
//Avoid infinite loops for people who end up orbiting themself through another orbiter
|
||||
checked_already[src] = TRUE
|
||||
if (!orbiter)
|
||||
qdel(src)
|
||||
return
|
||||
@@ -55,9 +57,14 @@
|
||||
lastloc = orbiter.loc
|
||||
for(var/other_orbit in orbiter.orbiters)
|
||||
var/datum/orbit/OO = other_orbit
|
||||
<<<<<<< HEAD
|
||||
if(OO == src)
|
||||
=======
|
||||
//Skip if checked already
|
||||
if(checked_already[OO])
|
||||
>>>>>>> 23d33a3... Merge pull request #33914 from optimumtact/thegreatestshow
|
||||
continue
|
||||
OO.Check(targetloc)
|
||||
OO.Check(targetloc, checked_already)
|
||||
|
||||
/atom/movable/var/datum/orbit/orbiting = null
|
||||
/atom/var/list/orbiters = null
|
||||
|
||||
Reference in New Issue
Block a user