From 3a11b4f068a6281ee64a6d4625bda67d825a48a5 Mon Sep 17 00:00:00 2001 From: Leo Date: Tue, 23 Jan 2018 10:43:07 -0200 Subject: [PATCH 1/2] Corrects addtime stack_trace typo --- code/controllers/subsystem/timer.dm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/code/controllers/subsystem/timer.dm b/code/controllers/subsystem/timer.dm index abd58467e4..9112a29542 100644 --- a/code/controllers/subsystem/timer.dm +++ b/code/controllers/subsystem/timer.dm @@ -353,7 +353,18 @@ SUBSYSTEM_DEF(timer) /proc/addtimer(datum/callback/callback, wait, flags) if (!callback) +<<<<<<< HEAD return +======= + CRASH("addtimer called without a callback") + + if (wait < 0) + stack_trace("addtimer called with a negative wait. Converting to 0") + + //alot of things add short timers on themselves in their destroy, we ignore those cases + if (wait >= 1 && callback && callback.object && callback.object != GLOBAL_PROC && QDELETED(callback.object)) + stack_trace("addtimer called with a callback assigned to a qdeleted object") +>>>>>>> f3b771b... Merge pull request #34774 from ShizCalev/addtimer-stack-track-typo wait = max(wait, 0) From e672ff43ea41b26a00f83c22fe3de45a2e7a6cf4 Mon Sep 17 00:00:00 2001 From: LetterJay Date: Tue, 23 Jan 2018 08:49:47 -0600 Subject: [PATCH 2/2] Update timer.dm --- code/controllers/subsystem/timer.dm | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/code/controllers/subsystem/timer.dm b/code/controllers/subsystem/timer.dm index 9112a29542..6c48531cf9 100644 --- a/code/controllers/subsystem/timer.dm +++ b/code/controllers/subsystem/timer.dm @@ -353,9 +353,6 @@ SUBSYSTEM_DEF(timer) /proc/addtimer(datum/callback/callback, wait, flags) if (!callback) -<<<<<<< HEAD - return -======= CRASH("addtimer called without a callback") if (wait < 0) @@ -364,7 +361,6 @@ SUBSYSTEM_DEF(timer) //alot of things add short timers on themselves in their destroy, we ignore those cases if (wait >= 1 && callback && callback.object && callback.object != GLOBAL_PROC && QDELETED(callback.object)) stack_trace("addtimer called with a callback assigned to a qdeleted object") ->>>>>>> f3b771b... Merge pull request #34774 from ShizCalev/addtimer-stack-track-typo wait = max(wait, 0) @@ -422,4 +418,4 @@ SUBSYSTEM_DEF(timer) #undef BUCKET_LEN -#undef BUCKET_POS \ No newline at end of file +#undef BUCKET_POS