diff --git a/code/__HELPERS/lists.dm b/code/__HELPERS/lists.dm index 25267f4f6eb..ed0f0c97809 100644 --- a/code/__HELPERS/lists.dm +++ b/code/__HELPERS/lists.dm @@ -211,23 +211,14 @@ proc/listclearnulls(list/list) return (result + R.Copy(Ri, 0)) //Mergesort: divides up the list into halves to begin the sort -/proc/sortAtom(var/list/atom/L, var/order = 1, first = 1) +/proc/sortAtom(var/list/atom/L, var/order = 1) if(isnull(L) || L.len < 2) - if(!L) - testing("sortAtom() called with null as first parameter!") return L - if(first) - var/msg = "sortAtom() called with list([L.len]): " - for(var/x in L) - msg += "'[x]'; " - testing(msg) var/middle = L.len / 2 + 1 - return mergeAtoms(sortAtom(L.Copy(0,middle), order, 0), sortAtom(L.Copy(middle), order, 0), order) + return mergeAtoms(sortAtom(L.Copy(0,middle)), sortAtom(L.Copy(middle)), order) //Mergsort: does the actual sorting and returns the results back to sortAtom /proc/mergeAtoms(var/list/atom/L, var/list/atom/R, var/order = 1) - if(!L || !R) - testing("mergeAtoms([L] ([L ? L.len : "*null*"]), [R] ([R ? R.len : "*null*"]))") var/Li=1 var/Ri=1 var/list/result = new() @@ -240,14 +231,8 @@ proc/listclearnulls(list/list) result += R[Ri++] if(Li <= L.len) - . = (result + L.Copy(Li, 0)) - if(!.) - testing("mergeAtoms returning [.]") - return - . = (result + R.Copy(Ri, 0)) - if(!.) - testing("mergeAtoms returning [.]") - return + return (result + L.Copy(Li, 0)) + return (result + R.Copy(Ri, 0)) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 0ea22f23d79..a3b80898aa2 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -21,9 +21,14 @@ if(auto_init && ticker && ticker.current_state == GAME_STATE_PLAYING) initialize() +/proc/generate_debug_runtime() // Guaranteed to runtime and print a stack trace to the runtime log + var/t = 0 // BYOND won't let us do var/t = 1/0 directly, but it's fine with this. + t = 1 / t + /atom/movable/Del() if(isnull(gcDestroyed) && loc) testing("GC: -- [type] was deleted via del() rather than qdel() --") + generate_debug_runtime() // stick a stack trace in the runtime logs // else if(isnull(gcDestroyed)) // testing("GC: [type] was deleted via GC without qdel()") //Not really a huge issue but from now on, please qdel() // else